Post Reply 
Thread for 67FUN2 game rom program development
11-22-2016, 10:37 PM (This post was last modified: 11-22-2016 11:21 PM by Dieter.)
Post: #2
RE: Thread for 67FUN2 game rom program development
(11-22-2016 08:02 PM)Gene Wrote:  Here is a game I have hastily rewritten from a HP 67 User's Library program: Paper, Rock, Scissors.

Goal: Choose paper, rock or scissors and try to beat the calculator. Get to a score of 10 wins first to beat it. Each win is +1. Each loss is -1. Paper is A, Rock is B and CUT (scissors is too long) is C.

How do you like the attached version?
The program uses a very compact evaluation routine – no flags, no elaborate tests, and the XROM version does it in 157 bytes.

PRS2a has its own seed prompt and RNG, while PRS2_XROM uses the two XROM functions of the Games ROM.

Code:
XEQ "PRS"        SEED?
0,12345 [R/S]    SCORE: 0

  [A]            YOU-PAPER
                  HP-ROCK
                 YOU WIN
                 SCORE: 1

  [B]            YOU-ROCK
                  HP-SCISSORS
                 YOU WIN
                 SCORE: 2

  [C]            YOU-SCISSORS
                  HP-SCISSORS
                 A TIE
                 SCORE: 2

  [B]            YOU-ROCK
                  HP-PAPER
                 YOU LOSE
                 SCORE: 1
  ...            ...

The program uses a synthetic RCL d/STO d to save/restore the display setting.

BTW, there also is an alternate version that displays both players in one line:
Code:
  [B]            ROCK
                 ROCK : SCISS
                 YOU WIN
                 SCORE: 2

Dieter


Attached File(s)
.zip  PRS2.zip (Size: 1.52 KB / Downloads: 5)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Thread for 67FUN2 game rom program development - Dieter - 11-22-2016 10:37 PM



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