Nim game: Difference between revisions

Line 3,762:
210 PRINT "I got the last token. I win. Better luck next time."
220 END</syntaxhighlight>
 
=={{header|Tiny Craft Basic}}==
<syntaxhighlight lang="basic">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"</syntaxhighlight>
 
=={{header|True BASIC}}==
305

edits