Code: Select all
sfb()
Prgm
ClrIO
[1,0,0]->d
[0,1,0]->e
[0,0,1]->f
[1,0,0,0]->g
[0,1,0,0]->h
[0,0,1,0]->i
[0,0,0,1]->j
Prompt x
While x>0
[0,0,0,0]->a
[0,0,0]->b
[0,0,0,0]->c
For t,1,x
rand(6)+rand(6)->y
If y<7 Then
If y=6 Then
b+d->b
ElseIf y=5 Then
a+j->a
ElseIf y=4 Then
a+i->a
ElseIf y=3 Then
a+h->a
Else
a+g->a
EndIF
ElseIf y>7 Then
If y=8 Then
b+f->b
ElseIf y=9 Then
c+g->c
ElseIf y=10 Then
c+h->c
ElseIf y=11 Then
c+i->c
Else
c+j->c
EndIF
Else
b+e->b
EndIf
EndFor
ClrIO
Disp x
Disp a
Disp b
Disp c
Prompt X
EndWhile
EndPrgmNUMBER OF INTERNALS
[TWO, THREE, FOUR, FIVE]
[SIX, SEVEN, EIGHT]
[NINE, TEN, ELEVEN, TWELVE]
x?
So results of:
8
[0,0,0,1]
[2,3,1]
[0,0,1,0]
x?
Means that 8 internals were rolled with results of FIVE rolled 1 time, SIX rolled 2 times, SEVEN rolled 3 times, EIGHT rolled 1 time, and ELEVEN rolled 1 time. To exit the program you enter any number less then 1. There is really no reason why something similar can't be done for almost any programable device.
My old, slow, TI-89 can "roll" 100 2d6's in 6 to 8 seconds.
