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

m
Line 1,342:
=={{header|Phix}}==
replace rand7() in [[Verify_distribution_uniformity/Naive#Phix]] with:
<lang Phix>function rand5dice5()
return rand(5)
end function
 
function rand7dice7()
while true do
integer r = rand5dice5()*5+randdice5(5)-3 -- ( ie 3..27, but )
if r<24 then return floor(r/3) end if -- (only 3..23 useful)
end while
7,803

edits