HP15c program: A dice

command         display

f LBL B      001-42,21,12   // LBL B 
f RAN #      002-   42 36
   6          003-       6
   *          004-      20
   1          005-       1
   +          006-      40
g INT        007-   43 44
g RTN        024-   43 32

This program uses the following labels: LBL B

Using the program

I start every program with a label. This way you can have a number of programs in your 15c and you just select which one to run by pressing f LABELNAME (f B in this case) or GSB LABELNAME (GSB B in this case).

You can use this as a real electronic dice. The HP15c has a good built-in random number function. To throw the dice you just press: GSB B (or you can type: f B)

The result is a number between 1 and 6 (including 1 and 6).

© Guido Socher