The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
(50G) RPSSL (Rock Paper Scissors Spock Lizard)
04-16-2017, 06:51 PM (This post was last modified: 06-15-2017 01:38 PM by Gene.)
Post: #1
(50G) RPSSL (Rock Paper Scissors Spock Lizard)
Everybody knows the ancient game of "Rock, Paper, Scissors" which even has its own Wikipedia page. Almost as well known is the much newer 5-weapon version called "Rock Paper Scissors Spock Lizard" (aka RPSSL), invented by Sam Kass and Karen Bryla. The simple rules are on its official website.

Here's a surprisingly short HP 50g program that plays RPSSL, user against calculator, complete with the official winning messages!

Note: "SCISSORS DECAPITATE LIZARD" has been changed to "SCISSORS STAB LIZARD" to fit the display.

INSTRUCTIONS:
(1) Run RPSSL. See "PICK ONE!" at the top of the screen. The soft menu keys are now labeled ROCK, PAPER, SCISSORS, SPOCK, LIZARD, and EXIT.
(2) Choose a weapon by pressing it. The calculator immediately chooses its weapon (without looking at yours!) and displays the result of the match, e.g. "YOU: SPOCK. ME: LIZARD. LIZARD POISONS SPOCK. I WIN!"
(3) Repeat step 2 until you are sufficiently entertained.
(4) Press the EXIT soft menu key to exit and return the menu to its previous contents.

Code:
%%HP: T(3)A(R)F(.);
\<< { "ROCK" "PAPER" "SCISSORS" "SPOCK" "LIZARD" } DUP "EXIT" + TMENU CLLCD "PICK ONE!" 1 DISP
WHILE -1 WAIT 10.1 - DUP 5 \<=
REPEAT DUP2 GET "YOU: " SWAP + 1 DISP RAND 5 * CEIL 3 PICK OVER GET
  " ME: " SWAP + 2 DISP DUP2 SAME { DROP2 "TIE!" "" 4 DISP }
  { DUP2 - 5 MOD 2 MOD 4 PICK PICK3 GET 5 PICK 5 PICK GET
  IF PICK3 THEN SWAP END 5 ROLL 5 ROLL MIN LASTARG MAX OVER -
  { { "COVERS" "BREAKS" "VAPORIZES" "CRUSHES" } { "CUT" "DISPROVES" "EATS" } { "SMASHES" "STAB" } { "POISONS" } }
  ROT GET SWAP GET " " + SWAP + " " SWAP + + 4 DISP "YOU" "I" IFTE " WIN!" + } IFTE 6 DISP
END DROP2 0 TMENU \>>

BYTES without name: 546.0 #3BA8h

Note: Originally posted on comp.sys.hp48 on 12 March 1998 for the HP 48.

<0|ΙΈ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(50G) RPSSL (Rock Paper Scissors Spock Lizard) - Joe Horn - 04-16-2017 06:51 PM



User(s) browsing this thread: 1 Guest(s)