Slot Machine for the HP-25/25C

Back to main page | Email me at: Gene!


The program presented below will simulate a slot machine on the HP-25. It was written by Craig Pearce (a fellow CHiP chapter member!) and appeared in the V3N2P16 issue of the PPC Journal (February 1976). Thanks to Craig who lives in Chicago!

Instructions:
0) Key the program in. Switch to RUN mode.
1) Store these constants: 10 STO 7, 0.1 STO 6, FIX 3. (You start with a $10 bankroll).
2) Change the angle mode to RADians, g RAD.
3) Store a decimal seed between 0 and 1 into memory 0, STO 0. Press f PRGM, R/S.
4) Each press of the R/S key costs you $0.10 and produces a three digit number representing the three symbols on a slot machine.
5) Repeat step 3 as long as you like.
6) At any time, you may view your winnings by press RCL 1.

The winning combinations take the form of:
0.aaa or 0.aa0, where a is any digit. Thus 0.777, 0.555, 0.550, 0.330, etc., are winning numbers. These pay $1.00.
0.000 is also a winning number. It pays $10.00.


Program Listing: Email if you have any questions.
Line      Instruction  Keycode
01         RCL 0        24 00
02         RCL 7        24 07
03         *            61
04         f SIN        14 04
05         g ABS        15 03
06         STO 0        23 00
07         EEX          33
08         6            06
09         +            51
10         f LASTX      14 73
11         -            41
12         g FRAC       15 01
13         STO 5        23 05
14         RCL 7        24 07
15         *            61
16         f INT        14 01
17         STO 2        23 02
18         f LASTX      14 73
19         g FRAC       15 01
20         RCL 7        24 07
21         *            61
22         f INT        14 01
23         STO 3        23 03
24         f LASTX      14 73
25         g FRAC       15 01
26         RCL 7        24 07
27         *            61
28         STO 4        23 04
29         RDN          22
30         f X NE Y     14 61
31         GTO 47       13 47
32         RCL 4        24 04
33         g X = 0      15 71
34         GTO 40       13 40
35         f X NE Y     14 61
36         GTO 47       13 47
37         RCL 2        24 02
38         f X NE Y     14 61
39         GTO 47       13 47
40         RCL 2        24 02
41         0            00
42         f X = Y      14 71
43         9            09
44         STO + 1      23 51 01
45         1            01
46         STO + 1      23 51 01
47         RCL 6        24 06
48         STO - 1      23 41 01
49         RCL 5        24 05

That's it!
Visitors since 8/5/97