You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: resources/md/diceroller.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,6 @@
2
2
3
3
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.
4
4
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.
6
6
7
7
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