Skip to content

Commit 07daf98

Browse files
committed
Dice Roller
1 parent 4d2d15e commit 07daf98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

resources/md/diceroller.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
Dice Roller can be run as an independent web page; see [Dice Roller](https://easycoder.github.io/examples/dice). If you view the page source you will see the entire script inside its special preformatted element.
44

5-
After declaring all its variables, the script attaches a variable to the <div> element defined at the top of the file. It then creates 2 dice and paints onto each one the number of spots chosen by a random election. Both the dice and its spots are <div> elements; the latter have rounded corners of 50% radius so they appear as circles.
5+
After declaring all its variables, the script attaches a variable to the <div> element defined at the top of the file. It then creates 2 dice and paints onto each one the number of spots chosen by a random selection. Both the dice and its spots are <div> elements; the latter have rounded corners of 50% radius so they appear as circles.
66

77
There are many ways of drawing dots on a dice. In this example we use a table with 6 rows, one for each possible value. In each of these rows are 6 pairs of top/left values giving the position of a dot. The renderer finds the right line then works its way along it, taking each pair of values and creating a dot using absolute positioning. When it reaches a zero in the line it stops.

0 commit comments

Comments
 (0)