Post Reply 
(11C) "Hi-Lo" Game
01-17-2018, 08:15 PM (This post was last modified: 01-17-2018 10:01 PM by Dieter.)
Post: #6
RE: (11C) "Hi-Lo" Game
(01-16-2018 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
02  RAN#
03  9
04  9
05  9
06  *
07  INT
08  1
09  +
10  STO 1
11  CLX
12  STO I
13  LBL 1
14  FIX 3
15  R/S
16  ISG
17  ENTER
18  ,
19  1
20  %
21  RCL I
22  +
23  x<>y
24  RCL 1
25  -
26  x=0?
27  GTO 2
28  ENTER
29  ABS
30  /
31  *
32  GTO 1
33  LBL 2
34  FIX 0
35  RCL I
36  RTN
37  LBL B
38  CLX
39  STO I
40  1
41  STO 2
42  EEX
43  3
44  STO 3
45  LBL 3
46  RCL 2
47  RCL 3
48  +
49  2
50  /
51  INT
52  STO 1
53  ISG
54  ENTER
55  EEX
56  3
57  /
58  RCL I
59  +
60  FIX 3
61  R/S
62  x=0?
63  GTO 2
64  x>0?
65  GTO 4
66  RCL 1
67  STO 2
68  GTO 3
69  LBL 4
70  RCL 1
71  STO 3
72  GTO 3

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
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: 1 Guest(s)