Mind boggling card trick: Difference between revisions

Content added Content deleted
(→‎{{header|REXX}}: added a pluralizer and a commatizer to the program, also added more information to the "results" output sentence, allowed the specification of the number of shuffles, created a (new) deck of cards as if they came from a new box.)
m (→‎{{header|REXX}}: reduced the number of random shuffles.)
Line 681: Line 681:
if trials=='' | trials=="," then trials= 1000 /*Not specified? Then use the default.*/
if trials=='' | trials=="," then trials= 1000 /*Not specified? Then use the default.*/
if #=='' | #=="," then #= 52 /* " " " " " " */
if #=='' | #=="," then #= 52 /* " " " " " " */
if shuffs=='' | shuffs=="," then shuffs= #%2 /* " " " " " " */
if shuffs=='' | shuffs=="," then shuffs= #%4 /* " " " " " " */
if datatype(seed, 'W') then call random ,,seed /*if integer, use this as a RANDOM seed*/
if datatype(seed, 'W') then call random ,,seed /*if integer, use this as a RANDOM seed*/
ok=0 /*the number of "expected" good trials.*/
ok=0 /*the number of "expected" good trials.*/
Line 727: Line 727:
{{out|output|text=  when using the default inputs:}}
{{out|output|text=  when using the default inputs:}}
<pre>
<pre>
Correctness of the mathematician's assertion: 100% (out of 10,000 trials) using a deck of 52 cards, and doing 26 shuffles.
Correctness of the mathematician's assertion: 100% (out of 10,000 trials) using a deck of 52 cards, and doing 13 shuffles.
</pre>
</pre>