DICE (16K ZX-81)
by Ray Elder
from ZX Computing (July 1986), page 81

You can choose to roll and display from one to five dice and they will be
spaced evenly along the lop of the screen. I am sure that you will find a use
for this routine, from the simple 21 type game to the more advanced Yahtzee
game, the exercise of programming that kind of logic will really stretch you!

Another application could be for resolving combat routines in adventure games
or adding a random factor for strategy programs, and then again I'm sure some
of you will devise a use for it which I wouldn't have dreamed of .....

This is a demo of how to roll the dice. I have chosen three, but the method
is as follows.

1. POKE 16514 the number of dice to roll, 1 to 5.

2. CALL the routine at address 16579 - DO NOT use RAND or the results will
tend to be rather similar each time.

3. Get the values for the dice by PEEKing addresses 16515/9 for dice 1 to 5
respectively.

And now all you've got to do is write your game ......