Rock, Paper, Scissors
Rock, Paper, Scissors
Play repeated rounds against the calculator and keep separate win, loss and tie counts.
- 167 bytes
- COMP mode
Worked examples
Example 1
Original game exercise. Assumed computer moves: C=2. Input order: 3 → 0. Read the output sequence and explain the result. These examples assume the stated draws solely to explain a game. Ordinary play is random and will usually show different values; these inputs do not force the illustrated secret or cards.
Answer
Standard solution (without a calculator)
- Apply the stated rules in order.
- 3>2 ⇒ +1
- (X,Y,M)=(1,0,0)
- Output sequence: 2, 1, 1, 0, 0
Example 2
Original game exercise. Assumed computer moves: C=2,1,3. Input order: 1 → 2 → 3 → 0. Read the output sequence and explain the result. These examples assume the stated draws solely to explain a game. Ordinary play is random and will usually show different values; these inputs do not force the illustrated secret or cards.
Answer
Standard solution (without a calculator)
- Apply the stated rules in order.
- (1,2) ⇒ −1; (2,1) ⇒ +1; (3,3) ⇒ 0
- (X,Y,M)=(1,1,1)
- Output sequence: 2, −1, 1, 1, 3, 0, 1, 1, 1
Example 3
Original game exercise. Assumed computer moves: C=3. Input order: 0.5 → 1 → 0. Read the output sequence and explain the result. These examples assume the stated draws solely to explain a game. Ordinary play is random and will usually show different values; these inputs do not force the illustrated secret or cards.
Answer
Standard solution (without a calculator)
- Apply the stated rules in order.
- 0.5∉{1,2,3} ⇒ −9
- (1,3) ⇒ +1; (X,Y,M)=(1,0,0)
- Output sequence: −9, 3, 1, 1, 0, 0
When to use it
Play repeated rounds against the calculator and keep separate win, loss and tie counts. These examples assume the stated draws solely to explain a game. Ordinary play is random and will usually show different values; these inputs do not force the illustrated secret or cards.
Input order
- A?: 1=rock, 2=paper, 3=scissors; 0 or blank EXE quits.
Output order
- Each round shows the computer move, then 1=win, 0=tie, −1=loss. Quitting shows wins, losses, ties, in that order. Invalid input gives −9 and consumes no move.
Conditions and limitations
- Rock beats scissors, scissors beat paper, paper beats rock. Equal moves tie. Errors never count as losses.
- The program sets Fix 0, overwrites its registers and Ans, then returns to Norm 1 on normal completion. AC during play may leave Fix 0. Previous values and display settings are not restored. Registers can be inspected; there is no anti-cheating protection.
- Equal-likelihood claims assume independent equally likely Ran# grid values; no cryptographic security is claimed. When used, rejection sampling has no fixed maximum number of draws.
Checking access…