As well as the total, I track and output individual die rolls and the
highest die roll. These are helpful for generating diceware passwords
or for Arkham Horror, which is a silly game where you roll a bunch of
d6s and count the 5s and 6s.
I don't know how good the RNG on these calculators really is, so maybe
don't rely on it for real things.
Inputs:
N: number of dice
D: number of sides
Outputs:
Alpha: space separated list of die rolls, sigma character, total result.
X: total dice result
Y: max die result
Registers:
00: loop variable
01: current total result
02: current max result
00 { 69-Byte Prgm }
01 LBL "DICE"
02 MVAR "N"
03 MVAR "D"
04 VARMENU "DICE"
05 LBL A
06 STOP
07 CLA
08 RCL "N"
09 STO 00
10 0
11 STO 01
12 STO 02
13 LBL B
14 RCL 02
15 RAN
16 RCLĂ— "D"
17 IP
18 1
19 +
20 AIP
21 |-" "
22 STO+ 01
23 X>Y?
24 STO 02
25 DSE 00
26 GTO B
27 RCL 02
28 RCL 01
29 |-"S"
30 AIP
31 AVIEW
32 GTO A
33 END