' This script counts the number of 7's in 6-roll intervals.
' The probability of a seven is 1/6 so on average you should see one 7 in every 6-roll interval.
' However, the probability of exactly 1 in 6 is not 1/6.
' Run the script for a large number of rolls to find out why.
If Initializing script Then
Name cs0.rollcount as "roll counter" :
Name cs1.#7s as "# of 7's in current interval" :
Name cs2.#intervals as "# of intervals" :
Name cs10 as "# of 6-roll intervals containing no 7s" :
Name cs11 as "# of 6-roll intervals containing exactly one 7" :
Name cs12 as "# of 6-roll intervals containing exactly two 7s" :
Name cs13 as "# of 6-roll intervals containing exactly three 7s" :
Name cs14 as "# of 6-roll intervals containing exactly four 7s" :
Name cs15 as "# of 6-roll intervals containing exactly five 7s" :
Name cs16 as "# of 6-roll intervals containing exactly six 7s" :
Name cs20 as "% of no 7s in 6 rolls" :
Name cs21 as "% of exactly one 7 in 6 rolls" :
Name cs22 as "% of exactly two 7s in 6 rolls" :
Name cs23 as "% of exactly three 7s in 6 rolls" :
Name cs24 as "% of exactly four 7s in 6 rolls" :
Name cs25 as "% of exactly five 7s in 6 rolls" :
Name cs26 as "% of exactly six 7s in 6 rolls" :
Else
Add 1 to cs0.rollcount
EndIf
If dice total = 7 Then Add 1 to cs1.#7s EndIf
If cs0.rollcount = 6 Then
add 1 to cs(cs1.#7s + 10) :
add 1 to cs2.#intervals :
cs99 = 0
Do
cs(20 + cs99) = 100 * cs(10 + cs99) / cs2.#intervals :
cs99 = cs99 + 1 : If cs99 > 6 Then ExitDo EndIf
Loop
cs0.rollcount = 0 :
cs1.#7s = 0
EndIf