Rock-paper-scissors: Difference between revisions
Content added Content deleted
m (→extended, 5 choices: added whitespace.) |
m (→traditional, 3 choices: aligned some statements.) |
||
Line 4,390: | Line 4,390: | ||
b.p= 'covers'; b.s= "cuts" ; b.r= 'breaks' /*verbs: how the choice wins. */ |
b.p= 'covers'; b.s= "cuts" ; b.r= 'breaks' /*verbs: how the choice wins. */ |
||
do forever; say; |
do forever; say; say prompt; say /*prompt the CBLF; then get a response.*/ |
||
c= word($.p $.s $.r, random(1, 3) ) |
c= word($.p $.s $.r, random(1, 3) ) /*choose the computer's first pick. */ |
||
m= max(@.r, @.p, @.s); c= w.r /*prepare to examine the choice history*/ |
m= max(@.r, @.p, @.s); c= w.r /*prepare to examine the choice history*/ |
||
if @.p==m then c= w.p /*emulate JC's: The Amazing Karnac. */ |
if @.p==m then c= w.p /*emulate JC's: The Amazing Karnac. */ |