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

add RPL
(the julia implementation)
(add RPL)
Line 2,104:
</pre>
 
=={{header|RPL}}==
<code>UNIF?</code> is defined at [[Verify distribution uniformity/Naive#RPL|Verify distribution uniformity/Naive]]
{{works with|Halcyon Calc|4.2.7}}
≪ ≪ RAND 5 * CEIL ≫ → dice5
≪ '''WHILE'''
dice5 EVAL 5 *
dice5 EVAL 1 - +
DUP 21 ≥
'''REPEAT''' DROP '''END'''
7 MOD 1 +
≫ ≫ '<span style="color:blue">DICE7</span>' STO
 
≪ RAND 5 * CEIL ≫ 100000 .1 <span style="color:blue">UNIF?</span>
{{out}}
<pre>
1: [ -12521 -12638 -12372 -12390 -12749 -18850 -18750 ]
</pre>
Watchdog timer limits the loop to 100,000 items.
=={{header|Ruby}}==
{{trans|Tcl}}
1,150

edits