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

Content added Content deleted
Line 1,245: Line 1,245:
end</lang>
end</lang>
=={{header|M2000 Interpreter}}==
=={{header|M2000 Interpreter}}==
<lang M2000 Interpreter>
We make a stack object (is reference type) and pass it as a closure to dice7 lambda function.
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.
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.
Line 1,251: Line 1,250:


We check for uniform numbers using +-5% from expected value.
We check for uniform numbers using +-5% from expected value.
<lang M2000 Interpreter>



Module CheckIt {
Module CheckIt {