Loading [MathJax]/extensions/Safe.js
The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Hi-Low Game with a twist
12-20-2023, 04:31 AM (This post was last modified: 12-21-2023 02:10 PM by Namir.)
Post: #1
Hi-Low Game with a twist
This is a version of the Hi-Low guessing game that has the following features:

1. You guess a secret number between 1 and 1000.
2. You have up to ten guesses to get it right!
3. You select the level of reliability for the LO/HI hints that guide your next guess. A value of 100 (percent) makes the program always tell the truth about the Hi?LO hints. A value of 0 (percent) makes the program always lie about the Hi?LO hints. A value of 50 (percent) makes the program tell the turh an expected 50% of the time about the Hi?LO hints. I sugges values like 95 or 90.

You can download the .raw file by clicking here.

To play the game:

1. Load the program.
2. Turn on the User mode.
3. Press the [A] key. The program display "SEED?"
4. Enter a seed value (>0 and <1) and press [R/S].
5. The program displays "%RELY".
6. Enter the reliability level for the hints in percent. Press [R/S].
7. The program display "GUESS?".
8. Enter a guess value and press [R/S].
9. If you did not guess the secret number, the program displays HI or LO hints to guide your next guess (and may lie to you). Press the [R/S] key.
10. Go to step 7.
11. If you guess the secret numbers within 10 attempts, the program displays "SUCCESS". Press [R/S] and the program displays the number of iterations that lead you to the correct answer.
12. If you failed to guess the secret numbers within 10 attempts, the program displays "SN IS " followed by the secret numer.
13. You can play again by either going back to step 3, or simply by pressing key [B] (to skip the prompts for the seed and % reliability) and go to step 7.


Code:
01 LBL "HILO"
02 LBL A
03 "SEED?"
04 PROMPT
05 1
06 X=Y?
07 LOG
08 FRC
09 X=0?
10 PI
11 STO 00
12 "%RELY?"
13 PROMPT
14 1E2
15 /
16 STO 03
17 LBL B
18 FIX 00
19 XEQ E
20 1E3
21 *
22 INT
23 1
24 +
25 STO 01
26 CLX
27 STO 02
28 "1 TO 1000"
29 PROMPT
30 LBL 00
31 1
32 STO+ 02
33 11
34 RCL 02
35 X>Y?
36 GTO 03
37 "GUESS?"
38 PROMPT
39 INT
40 RCL 01
41 X<>Y
42 X=Y?
43 GTO 02
44 X>Y?
45 GTO 01
46 XEQ E
47 RCL 03
48 "HI"
49 X>Y?
50 "LO"
51 PROMPT
52 GTO 00
53 LBL 01
54 XEQ E
55 RCL 03
56 "LO"
57 X>Y?
58 "HI"
59 PROMPT
60 GTO 00
61 LBL 02
62 "SUCCESS"
63 BEEP
64 PROMPT
65 "ITRS="
66 ARCL 02
67 FIX 05
68 PROMPT
69 GTO B
70 LBL 03
71 TONE 9
72 "SN IS "
73 ARCL 01
74 FIX 05
75 PROMPT
76 GTO B
77 LBL E
78 997
79 RCL 00
80 *
81 FRC
82 STO 00
83 RTN
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Hi-Low Game with a twist - Namir - 12-20-2023 04:31 AM
RE: Hi-Low Game with a twist - Gene - 12-21-2023, 04:14 AM
RE: Hi-Low Game with a twist - Namir - 12-21-2023, 02:08 PM



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