Four Digit Bagels for the HP-19C/29C

Back to main page | Email me at: Gene!


This game first appeared in the V6N3P32 PPC Journal in August 1979 by John Dearing. Thanks to John wherever he is today!

This program plays the classic game of mastermind on the HP-19C or HP-29C. Note that all digits on a number are different. So, 3333 will never be the answer.

User Instructions:
1) Key in program
2) Store seed (0 < seed < 1) STO 6
3) Set display mode - FIX 1
4) Store -94 in R0 - STO 0 <- Important
5) Store 0.1 in R7
6) Generate the four digit number (all digits will be different: GSB 1. Display shows 0.0.
7) Enter a 4 digit guess. and press R/S.
8) Either a clue in the form of A.B will be displayed (with A being the number of digits guess correctly in the right place and B being the number of digits being guessed correctly but in the WRONG place), or the total number of guesses it took for you to find the answer will be displayed as a negative flashing number.
9) If you have not solved it yet, go back to step 7.
10) When you have won the game, press CLX and go back to step 6 to play again.


Program Listing Notes: 1) Step 27 is Clear Statistics registers. 2) The RC. instruction in step 33 is correct. Press RCL then the decimal key, then the 5 key. 3) RDN stands for Roll Down. 4) The ST+. 5 in steps 65, 72, 79 and 86 are just that. Press STO + then the decimal point, then the 5 key. 5) X NE Y? is X not equal to Y. 6) TAN-1 is inverse tangent. Enjoy!
Line      Instruction
01         LBL 1
02         GSB 0
03         STO 1
04         GSB 0
05         STO 2
06         GSB 0
07         STO 3
08         GSB 0
09         STO 4
10         RCL 1
11         X = Y?
12         GTO 1
13         RCL 3
14         X = Y?
15         GTO 1
16         RCL 2
17         RCL 4
18         X = Y?
19         GTO 1
20         0
21         STO 9
22         LBL 2
23         R/S
24         STO 8
25         1
26         STO- 9
27         CLSUM
28         GSB 9
29         GSB 9
30         GSB 9
31         GSB 9
32         4
33         RC. 5
34         X NE Y?
35         GTO 2
36         LBL 3
37         RCL 9
38         PSE
39         GTO 3
40         LBL 9
41         RCL 1
42         RCL 2
43         RCL 3
44         RCL 4
45         STO 1
46         RDN
47         STO 4
48         RDN
49         STO 3
50         RDN
51         STO 2
52         RCL 8
53         RCL 7
54         *
55         ENTER
56         INT
57         STO 8
58         -
59         RCL 7
60         /
61         RCL 1
62         X NE Y?
63         GTO i
64         1
65         ST+. 5
66         RDN
67         RDN
68         RCL 2
69         X NE Y?
70         GTO i
71         RCL 7
72         ST+. 5
73         RDN
74         RDN
75         RCL 3
76         X NE Y?
77         GTO i
78         RCL 7
79         ST+. 5
80         RDN
81         RDN
82         RCL 4
83         X NE Y?
84         RTN
85         RCL 7
86         ST+. 5
87         RTN
88         LBL 0
89         RCL 6
90         TAN-1
91         FRC
92         STO 6
93         RCL 7
94         /
95         INT
96         X = Y?
97         GTO 0
98         RTN
That's all there is to it. Enjoy!
Visitors since 7/20/97