Post Reply 
(11C) "Hi-Lo" Game
01-18-2018, 08:18 AM (This post was last modified: 01-18-2018 08:23 AM by Dieter.)
Post: #9
RE: (11C) "Hi-Lo" Game
(01-17-2018 11:39 PM)Gerson W. Barbosa Wrote:  Very nice to play it on my very first HP-15C, thanks! Yes, those were the days (1983 or so).

Add a new feature: let the user decide about the largest number to guess. :-)

First, add this code:

Code:
LBL E
INT
9
x≤y?
X<>Y
9
9
9
x>y?
X<>Y
STO 0
RTN

Then change the original program at LBL A and LBL B:

Code:
LBL A
RCL 0
RAN#
*
INT
...

LBL B
CLX
STO I
RCL 0
1
STO 2
+
STO 3
LBL 3
...

Enter the max. number to guess (between 9 and 999) and press f [E].
Input out of this range is automatically corrected.
Then start a new game with f [A] or f [B].

If you want to make sure that the program can be run without a max. number input, simply add a GSB E after each of the two RCL 0 instructions. Whatever happens to be in R0 then is adjusted to an integer between 9 and 999.

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


Messages In This Thread
(11C) "Hi-Lo" Game - Gamo - 01-15-2018, 01:11 PM
RE: (11C) "Hi-Lo" Game - Dieter - 01-15-2018, 06:16 PM
RE: (11C) "Hi-Lo" Game - Gerson W. Barbosa - 01-16-2018, 01:54 AM
RE: (11C) "Hi-Lo" Game - Dieter - 01-16-2018, 08:25 AM
RE: (11C) "Hi-Lo" Game - Gerson W. Barbosa - 01-16-2018, 08:35 PM
RE: (11C) "Hi-Lo" Game - Dieter - 01-17-2018, 08:15 PM
RE: (11C) "Hi-Lo" Game - Gerson W. Barbosa - 01-17-2018, 11:39 PM
RE: (11C) "Hi-Lo" Game - Dieter - 01-18-2018 08:18 AM
RE: (11C) "Hi-Lo" Game - Gamo - 01-18-2018, 01:25 AM



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