Post Reply 
Raw files for these HP 67 program listings ?
08-31-2016, 01:31 PM (This post was last modified: 08-31-2016 01:49 PM by Dieter.)
Post: #3
RE: Raw files for these HP 67 program listings ?
(08-30-2016 06:13 PM)Gene Wrote:  Looking for some help. Angel has agreed (given in) to the creation of an HP 67/97 game rom. Yay. Haha. The idea here was to have available on the 41CL and Emulators some games for the hP 67/97 that are not available in the same way directly on the HP 41. It also gives possible access to some very good USER written games such as the ones below in addition to the HP 67 solution books.

I do not think that translating HP67/97 programs 1:1 for the HP41 is a good idea. This is especially true for games – the 41 allows much better programs due to its alpha input/output, and many things can be done much more elegantly.

Consider the Jive Turkey example. It's an HP67/97 translation of a TI58/59 program that uses a rather complicated random number generator (looks like the one from the ML-01 module) and generates output that is not always unambiguous – cf. the instructions on the linked website with the program. It also uses a strange flag technique to generate a misleading (=wrong) output if it decides to lie to the user. Also all (well, most) data memory is cleared. Which is less of a problem with the 67/97 (turn it off and everything is lost anyway) than on an HP41 with its continuous memory.

Compare this to a more compact program that uses the HP41's features. The following code was written in 15 minutes, so there may be errors, but you get the idea:

Code:
LBL "JT"
100
"TRUTH%=?"
PROMPT
1
%
STO 03
999
"MAX. NUMBER?"
PROMPT
ABS
INT
STO 02
XEQ 99
*
1
+
INT
STO 01
CLX
STO 00
"GUESS?"
LBL 01
PROMPT
ISG 00
ENTER
RCL 01
-
X=0?
GTO 02
SIGN
RCL 03
XEQ 99
-
SIGN
*
"HIGH"
X<0?
"LOW"
GTO 01
LBL 99
RCL 04
PI
+
X^2
FRC
STO 04
RTN
LBL 02
RCL 00
FIX 0
CF 29
" "
ARCL 00
FIX 4
SF 29
"├ GUESSES"
AVIEW
BEEP
END

Usage:

Code:
Before the first usage it is recommended to store a random seed
(positive number with fractional part) in R04:

e.g. 0.1234 STO 04

[XEQ] "JT"    TRUTH%=?

Enter percentage of true answers.
No entry sets this to 100%, i.e. all answers are correct
Which means it's a simple Hi-Lo-Game.

70 [R/S]           MAX. NUMBER?

Enter max. number to guess
Default value is nmax = 999

100 [R/S]          GUESS?

Now enter your guesses:

50  [R/S]          LOW
80  [R/S]          LOW   ' here the program is cheating, actually 80 is high
80  [R/S]          HIGH  ' same input this time yields the true answer
70  [R/S]          HIGH
65  [R/S]          LOW
67  [R/S]          6 GUESSES

The program takes advantage of input prompts and alpha output, it uses the signum function to generate the high/low output and change it if it decides to cheat, and the max. number to guess can be specified by the user. There's no need to initialize any flags (the program doesn't use any), and no HP67/97 commands like ISZ(i) are required. All this is done in less steps than the original version.

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Raw files for these HP 67 program listings ? - Dieter - 08-31-2016 01:31 PM



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