Jump to content

Dice game probabilities: Difference between revisions

m
→‎optimized: changed a comment, moved a statement.
(→‎Algorithm: marked as needs-review (probably as a result of cut-and-paste errors).)
m (→‎optimized: changed a comment, moved a statement.)
Line 1,316:
numeric digits 100 /*increase│decrease for heart's desire.*/
call game 9 4, 6 6 /*1st player: 9 dice, 4 sides; 2nd player: 6 dice, 6 sides*/
say
call game 5 10, 6 7 /* " " 5 " 10 " " " 6 " 7 " */
exit /*stick a fork in it, we're all done. */
Line 1,335 ⟶ 1,334:
end /*j*/
say 'The % probability for first player to win is ' format(winP*100, , 30) "%."
say /* ↑ */
return /*display 30 decimal digits────┘ */
/*──────────────────────────────────────────────────────────────────────────────────────*/
Cookies help us deliver our services. By using our services, you agree to our use of cookies.