(11C) "HiLo" Game

01152018, 01:11 PM
(This post was last modified: 01162018 05:17 AM by Gamo.)
Post: #1




(11C) "HiLo" Game
This HiLo program randomly pick numbers between 0 and 99
You make a guess and program will tell you if it High or Low Continue guessing until the display flash all 8's and the number of guesses you took to hit on the correct number. The calculator then selects a new number to start a new game. How to play: 1. LBL E (Display show 0.00) for Game Reset 2. Enter number the display read "Hi.00" or "L0.00" when look inverted. 3. When hit the right number all 8's flashing on display then show the number of guesses you took and automatically start new game. Code:
Gamo 

01152018, 06:16 PM
(This post was last modified: 01152018 08:24 PM by Dieter.)
Post: #2




RE: (11C) "HiLo" Game
(01152018 01:11 PM)Gamo Wrote: This HiLo program randomly pick numbers between 1 and 100 There are several issues with this program:  The program does not generate a number between 1 and 100, but between 0 and 99.  If you turn the display upside down it does not read "hi" and "Lo" but "00hI" and "LOO"  The guess counter in R5 is not initialized. It is reset to zero after the game instead of at the beginning.  Most important: the program evaluates the first guess incorrectly. The first hint given by the program compares the user input not with the hidden number but with 14. This is because the hidden number is assumed to be on the stack, but on the first run it isn't. Try it: Start the program and enter 14 as your first guess. The program will say that this is the correct number. You generally should not carry the secret number on the stack. If the user presses only one additional key the whole stack is disturbed any everything will go wrong. But you don't have to do this – the number is stored in R1, so there is no need at all to keep it on the stack. BTW, I like this idea of displaying hI and LO with the numbers 14 and 07. This reminds me of other early calculator games where messages had to be read upside down – remember the Nim program in the 34C manual which displayed 55178 ("bliss") or 3507.1 ("I lose") ? But what about displaying this in the two exponent digits? 3. 07 => 3. guess is LO 4. 14 => 4. guess is HI And what about a counter? You lose if you haven't made it in 8 guesses. ;) Finally, on the 15C there is an easy way to get a flashing display: simply cause an overflow. Maybe you can also test this on the 11C – I'm not sure if it works the same way. If it does, EEX 2 10^x RCL 5 may be used to show the number of guesses with a flashing display. Dieter 

01162018, 01:54 AM
Post: #3




RE: (11C) "HiLo" Game
(01152018 06:16 PM)Dieter Wrote: Finally, on the 15C there is an easy way to get a flashing display: simply cause an overflow. On the 15C you can simply set flag 9 for this (g SF 9). This flag is not available on the 11C, I’m afraid. The HILO game was available on the Master Library Module for the Ti58C/59 calculator. The secret number was in the range 01023 or 11024 (I don’t remember). Mastermind was available as a program listing in the user’s manual (There’s a 42S version here). Gerson. 

01162018, 08:25 AM
(This post was last modified: 01162018 08:33 AM by Dieter.)
Post: #4




RE: (11C) "HiLo" Game
(01162018 01:54 AM)Gerson W. Barbosa Wrote: On the 15C you can simply set flag 9 for this (g SF 9). Interesting – I didn't know that. But now I found it in the 15C manual: Quote:If you set flag 9 manually (SF 9), it causes the display to blink irrespective I'd like to have something like that on other calculators, too. ;) (01162018 01:54 AM)Gerson W. Barbosa Wrote: This flag is not available on the 11C, I’m afraid. And the display doesn't even flash on overflow ?) (01162018 01:54 AM)Gerson W. Barbosa Wrote: The HILO game was available on the Master Library Module for the Ti58C/59 calculator. The secret number was in the range 01023 or 11024 (I don’t remember). Yes, I remember. This might have been my very first "computer game". The number was between 1 and 1023. (01162018 01:54 AM)Gerson W. Barbosa Wrote: Mastermind was available as a program listing in the user’s manual (There’s a 42S version here). Mastermind becomes interesting if it's the calculator that has to guess your code. 8) Dieter 

01162018, 08:35 PM
Post: #5




RE: (11C) "HiLo" Game
(01162018 08:25 AM)Dieter Wrote:(01162018 01:54 AM)Gerson W. Barbosa Wrote: This flag is not available on the 11C, I’m afraid. No, it doesn’t. It behaves like the 12C, just a static “9.999999 99” display. (01162018 08:25 AM)Dieter Wrote:(01162018 01:54 AM)Gerson W. Barbosa Wrote: The HILO game was available on the Master Library Module for the Ti58C/59 calculator. The secret number was in the range 01023 or 11024 (I don’t remember). I’d forgotten about the exact range. Thanks! Gerson. 

01172018, 08:15 PM
(This post was last modified: 01172018 10:01 PM by Dieter.)
Post: #6




RE: (11C) "HiLo" Game
(01162018 08:35 PM)Gerson W. Barbosa Wrote: I’d forgotten about the exact range. Thanks! Those were the days. Remembering this extremely simple game, here is a version for the 11C which should also run on some other calculators, e.g. the 34C. 15C users replace ISG with ISG I ...and may add a SF 9 after LBL 2. ;) Code: 01 LBL A Note: the ENTER following the two ISGs is a dummy instruction. Usage: f [A] starts a new game where the user has to guess the calculator's number which is between 1 and 999. Enter a guess and press [R/S]. The answer is displayed as ±g.nnn where g is the number of guesses so far, nnn is the entered guess and the sign indicates whether the input was too low or too high. So –3,750 means that "750" is your third guess and this is less than the secret number. After success the number of guesses is displayed. f [B] starts a new game where the calculator tries to guess the user's secret number, again something between 1 and 999. The display shows g.nnn where g is the number of guesses so far and nnn is the calculator's guess itself. So 1,500 means that the first guess is 500. Now enter a positive or negative value to indicate whether the guess was too high or too low. Since the displayed number is always positive at this point you may simply press [R/S] for "high" or [CHS] [R/S] for "low". If the calculator was successful, enter zero. This returns the total number of guesses. Example: f [A] => 0,000 (If you want to reproduce the following results type 777 STO 1 now) 500 [R/S] => –1,500 500 is low 800 [R/S] => 2,800 800 is high 750 [R/S] => –3,750 750 is low 780 [R/S] => 4,780 780 is high 775 [R/S] => –5,775 775 is low 777 [R/S] => 6 So you found the number in six guesses. Now let the calculator find out your secret number, e.g. 468: f [B] => 1,500 500 is high [R/S] => 2,250 250 is low [CHS] [R/S] => 3,375 375 is low [CHS] [R/S] => 4,437 437 still is low [CHS] [R/S] => 5,468 Bingo 0 [R/S] => 5 Dieter 

01172018, 11:39 PM
Post: #7




RE: (11C) "HiLo" Game
(01172018 08:15 PM)Dieter Wrote:(01162018 08:35 PM)Gerson W. Barbosa Wrote: I’d forgotten about the exact range. Thanks! Very nice to play it on my very first HP15C, thanks! Yes, those were the days (1983 or so). Code: 031 LBL 2 The total number of steps has remained the same (recall arithmetic has been used in four occasions). Gerson. 

01182018, 01:25 AM
(This post was last modified: 01182018 01:35 AM by Gamo.)
Post: #8




RE: (11C) "HiLo" Game
Thank You Dieter and Gerson W. Barbosa
Very interesting HiLo Game that Dieter make with added LBL B that let the calculator make a guess then tell calculator that the guess is Hi or Lo. I'm 7 years old when HP Voyager Series release on 1981 not until when I was 16 years old that I start to know one of the HP Voyager Series which is the HP12C that my StepSister use on her MBA course. At that time I try to play around with it and don't know how to use it. That memory kept in to my mine until I saw the newest release of the HP12C+ on Amazon and finally got one but this time now I'm 40+ year old !! Since I got the 12C+ I start to learn on how to use RPN logic and Program from Owner's Handbook and from the web. This HP Calculators Forum is very helpful with many suggestion, tip and trick. Especially Thankful to Dieter too. Gamo 

01182018, 08:18 AM
(This post was last modified: 01182018 08:23 AM by Dieter.)
Post: #9




RE: (11C) "HiLo" Game
(01172018 11:39 PM)Gerson W. Barbosa Wrote: Very nice to play it on my very first HP15C, 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 Then change the original program at LBL A and LBL B: Code: LBL A 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 

« Next Oldest  Next Newest »

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