Post Reply 
(42S) Nimb
09-05-2019, 06:00 AM (This post was last modified: 09-05-2019 06:04 AM by NoEqualsButton.)
Post: #1
(42S) Nimb
This is more-or-less the classic misère game. It uses soft key inputs instead of the usual numeric input, so no checks are required on the input value, it will always be a valid move.

Usage:

XEQ "NIMB"

Code:

00 { 228-Byte Prgm }
01▸LBL "GETY"
02 1
03 -
04 4
05 ÷
06 FP
07 4
08 ×
09 IP
10 X=0?
11 1
12 "My move "
13 ARCL ST X
14 AVIEW
15 PSE
16 RTN
17 END
18▸LBL "NIMB"
19 FIX 00
20 15
21 STO "COUNT"
22▸LBL 00
23 XEQ "GETX"
24 STO- "COUNT"
25 RCL "COUNT"
26 X=0?
27 GTO 01
28 XEQ "GETY"
29 STO- "COUNT"
30 RCL "COUNT"
31 X=0?
32 GTO 02
33 GTO 00
34▸LBL 01
35 CLMENU
36 "I WIN!"
37 AVIEW
38 TONE 9
39 TONE 4
40 TONE 1
41 RTN
42▸LBL 02
43 CLMENU
44 "YOU WON"
45 AVIEW
46 TONE 1
47 TONE 4
48 TONE 9
49 RTN
50 END
51▸LBL "GETX"
52 CLMENU
53 "ONE"
54 KEY 1 GTO 01
55 RCL "COUNT"
56 2
57 X>Y?
58 GTO 99
59 "TWO"
60 KEY 2 GTO 02
61 X<>Y
62 3
63 X>Y?
64 GTO 99
65 "THREE"
66 KEY 3 GTO 03
67▸LBL 99
68 MENU
69 RCL "COUNT"
70 STOP
71▸LBL 01
72 1
73 RTN
74▸LBL 02
75 2
76 RTN
77▸LBL 03
78 3
79 RTN
80 END

Steve

HP11C, HP12C, HP15C, HP16C, HP25, HP32S, HP33C, HP41CV, DM42, HP46, HP65
Find all posts by this user
Quote this message in a reply
Post Reply 




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