Download the original BASIC code. Check out the original page the text below was taken from in the Book.
Instructions From the Book
The program presents pictorial drill on addition facts using printed dice with no reading involved. It is good for beginning addition, since the answer can be derived from counting spots on the dice as well as by memorizing math facts or awareness of number concepts. It is especially effective run on a CRT terminal.
It was originally written by Jim Gerrish, a teacher at the Bernice A. Ray School in Hanover, New Hampshire.
MATH DICE
CREATIVE COMPUTING MORRISTOUN, NEW JERSEY
Modifications For This Version
I considered making the dice look like the command-line CRT terminal version as in the original BASIC version, but I opted for more graphical looking dice. This version of the game has the added feature of allowing the user to choose what skill level of math they would like to do. The original was only addition. This version allows for all four operations (additional, subtraction, multiplication, and division), but the user can choose which level to use.
Level 0: Addition only.
Level 1: Addition & Subtraction with no negative answers.
Level 2: All of level 1, & Multiplication & Subtraction with negative answers.
Level 3: All of level 2, & Division where numerator is always larger than the denominator.
Level 4: All of level 3, & Division with the numerator less than the denominator (e.g., 1 divided by 3)
I'm considering, in the future, adding a score that tells you how many you got write and wrong after x number of rounds, or something like that. Maybe it'll just be a "click here to see your score" button, or maybe there will be a "quit" button which ends the game and gives the tally.
Technical Stuff
This is variation is written in PHP using session and post variables. The dice are created using strictly HTML and CSS. The HTML is generated in a PHP loop inside of a function that accepts, as a parameter, the number to show on the die. This value is then added to the die as a class name. The class name "one" for example is styled to have a black circle in the middle of the die. I may consider adding some animation and / or a little more CSS to give them a 3D look. Also, I may add a DB component to allow users to keep track of their score as mentioned in the above section. That said, however, I'm very happy with the current final version. So . . .
Enjoy Math Dice!
Math Dice
The game is simple. Two random dice will appear with a mathematical operation between them. Enter the answer to the mathematical question. Be sure to round to two decimal places (e.g., 1.666666666666667 becomes 1.67). That's it. Enjoy!
Level 0: Addition only.
Level 1: Addition & Subtraction with no negative answers.
Level 2: All of level 1, & Multiplication & Subtraction with negative answers.
Level 3: All of level 2, & Division where numerator is always larger than the denominator.
Level 4: All of level 3, & Division with the numerator less than the denominator (e.g., 1 divided by 3)