Anonymous user
Rock-paper-scissors: Difference between revisions
m
→{{header|REXX}}: added/changed comments in the REXX section header, added a programming note in the output section.
mNo edit summary |
m (→{{header|REXX}}: added/changed comments in the REXX section header, added a programming note in the output section.) |
||
Line 3,415:
This version of the REXX program:
::* allows the human player to abbreviate their choice
::* issues appropriate error messages for an incorrect (or no) choice(s)
::* allows the human player to QUIT at any time
::* keeps track of the human player's responses (to hopefully make
::* uses proper "English" ''rock breaks scissors''
<lang rexx>/*REXX pgm plays rock-paper-scissors with a CBLF (carbon-based life form*/
Line 3,454 ⟶ 3,455:
end /*forever*/
/*stick a fork in it, we're done.*/</lang>
Programming note: REXX program statement (line) 15:
<lang> upper a; a1=left(a,1) /*uppercase answer, get 1st char.*/</lang>
could be replaced with a more compact (and faster and obtuse and less idiomatic) version:
<lang>parse upper var a a 1 a1 2</lang><br>
'''output''' with various responses from the user (output shown is a screen scraping):
<pre>
|