Dice game probabilities: Difference between revisions
→{{header|M2000 Interpreter}}
Line 1,302:
local m=@PlayAll(dice1,dice2, games) : local tt=timecount
print "Time to fill the buffer with random bytes ";str$(tt, "#0.00 ms")
local s1=dice1-1, s2=dice2-1, k, l
print "Buffer size ";str$(len(m)/1024,"#0.#");" Kbyte": Refresh
profiler
Line 1,310:
if n1>n2 then k++ else if n1<n2 then l++
next
print "Games Total "; games
print "Player 1 wins ";k; " probability of winning:" ;str$(k/games, "#0.00 %")
print "Player 2 wins ";l; " probability of winning:" ;str$(l/games, "#0.00 %")
print "Number of ties ";
print "Execution time ";str$(timecount/1000, "#0.0 s")
End Sub
|