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

Line 1,245:
 
=={{header|VBScript}}==
<lang vb>optionOption explicitExplicit
{{improve|VBScript|Use the distribution checker once it's been written.}}
<lang vb>option explicit
 
function irandom(n)dice5
dim rolls
irandomdice5 = int(rnd*n5) + 1
rolls = "11,12,13,14,15,21,22,23,24,25,31,32,33,34,35,41,42,43,44,45,51,"
 
randomize timer
 
function irandom(n)
irandom = int(rnd*n)+1
end function
 
function d7()dice7
dim j
do
j = instr(5 rolls,* irandom(5)dice5 &+ irandom(5)dice5 - )6
if loop until j <> 0 then21
d7 dice7 = (((j-1)/3) mod 7) + 1
exitend function
</lang>
end if
loop
end function</lang>
Anonymous user