Rock-paper-scissors: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 1,596: | Line 1,596: | ||
return "Computer played <computer>. <CheckWinner(human, computer)> wins!"; |
return "Computer played <computer>. <CheckWinner(human, computer)> wins!"; |
||
}</lang> |
}</lang> |
||
Sample output: |
|||
<lang rascal>rascal>RPS("Rock") |
|||
str: "Computer played Rock. Nobody wins!" |
|||
rascal>RPS("Rock") |
|||
str: "Computer played Rock. Nobody wins!" |
|||
rascal>RPS("Rock") |
|||
str: "Computer played Sciccors. Rock wins!" |
|||
rascal>RPS("Rock") |
|||
str: "Computer played Paper. Paper wins!" |
|||
rascal>RPS("Rock") |
|||
str: "Computer played Paper. Paper wins!" |
|||
rascal>RPS("Rock") |
|||
str: "Computer played Paper. Paper wins!" |
|||
rascal>RPS("Rock") |
|||
str: "Computer played Paper. Paper wins!" |
|||
rascal>RPS("Rock") |
|||
str: "Computer played Rock. Nobody wins!" |
|||
rascal>RPS("Rock") |
|||
str: "Computer played Paper. Paper wins!" |
|||
rascal>RPS("Rock") |
|||
str: "Computer played Paper. Paper wins!"</lang> |
|||
=={{header|Ruby}}== |
=={{header|Ruby}}== |