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

Content added Content deleted
(Add Factor implementation.)
(→‎{{header|J}}: correct var name)
Line 942: Line 942:
n=. */y NB. product of vector y is total number of D7 rolls required
n=. */y NB. product of vector y is total number of D7 rolls required
rolls=. '' NB. initialize empty noun rolls
rolls=. '' NB. initialize empty noun rolls
while. n > #res do. NB. checks if if enough D7 rolls accumulated
while. n > #rolls do. NB. checks if if enough D7 rolls accumulated
rolls=. rolls, getD7 >. 0.75 * n NB. calcs 3/4 of required rolls and accumulates getD7 rolls
rolls=. rolls, getD7 >. 0.75 * n NB. calcs 3/4 of required rolls and accumulates getD7 rolls
end.
end.