20 lines
528 B
Text
20 lines
528 B
Text
5 cls
|
|
10 print "NIM"
|
|
20 let h = 12
|
|
30 print "There are ", h ," tokens remaining."
|
|
40 input "How many would you like to take? ", t
|
|
50 if t > 3 then 140
|
|
60 if t < 1 then 140
|
|
70 let h = h - t
|
|
80 if h = 0 then 160
|
|
90 let t = 4 - t
|
|
100 print "I will take ", t ," tokens."
|
|
110 let h = h - t
|
|
120 if h = 0 then 180
|
|
130 goto 30
|
|
140 print "You must take between 1 to 3 tokens."
|
|
150 goto 40
|
|
160 print "Congratulations. You got the last token."
|
|
170 goto 190
|
|
180 print "I got the last token. I win. Better luck next time."
|
|
190 shell "pause"
|