Seven-sided dice from five-sided dice: Difference between revisions

m
Line 1,245:
end</lang>
=={{header|M2000 Interpreter}}==
We make a stack object (is reference type) and pass it as a closure to dice7 lambda function. For each dice7 we pop the top value of stack, and we add a fresh dice5 (random(1,5)) as last value of stack, so stack used as FIFO. Each time z has the sum of 7 random values.
For each dice7 we pop the top value of stack, and we add a fresh dice5 (random(1,5)) as last value of stack, so stack used as FIFO.
Each time z has the sum of 7 random values.
 
We check for uniform numbers using +-5% from expected value.
<lang M2000 Interpreter>
 
 
Module CheckIt {
Def long i, calls, max, min
Line 1,303 ⟶ 1,299:
 
 
1 100081100214
2 99519100336
3 99897100049
4 9982399505
5 100649 99951
6 100265 99729
7 99766100216
min=9951999505 expected=100000 max=100649100336
Verify Uniform:uniform
</pre >
Anonymous user