Anonymous user
Monty Hall problem: Difference between revisions
m
→version 2
m (moved the task's requirements at the beginning to the ;Task: section, broke apart a long paragraph for easier comprehension, consolidate the references, added ;Note: and ;query: sections, added whitespace, noted that the video is on YouTube.) |
m (→version 2) |
||
Line 1,584:
: play ( - f ) setup choose reveal applyStrategy open ;
: record ( f ) 1 and wins +! ;
: run 0 wins ! rounds 0 ?DO play record LOOP ;
: result wins @ 0 d>f rounds 0 d>f f/ 100e f* ;
' keep IS applyStrategy run ." Keep door => " .result cr
' switch IS applyStrategy run ."
bye</lang>▼
▲run ." Switch door => " result f. '%' emit cr
▲</lang>
{{out}}
|