Nim game: Difference between revisions
Content added Content deleted
(Added Z80 Assembly version) |
Basicgames (talk | contribs) |
||
Line 744: | Line 744: | ||
==={{header|Craft Basic}}=== |
==={{header|Craft Basic}}=== |
||
<syntaxhighlight lang="basic"> |
<syntaxhighlight lang="basic">let h = 12 |
||
bgcolor 0,180,0 |
|||
cls |
|||
wait |
|||
let h = 12 |
|||
label loop |
label loop |
||
alert "There are ", h ," tokens remaining." |
|||
input "How many would you like to take? ", t |
input "How many would you like to take? ", t |
||
if t > 3 or t < 1 then |
if t > 3 or t < 1 then |
||
alert "You must take between 1 to 3 tokens." |
|||
endif |
endif |
||
Line 765: | Line 759: | ||
if h - t < 0 then |
if h - t < 0 then |
||
alert "You cannot take that many. There's only ", h ," left." |
|||
endif |
endif |
||
Line 794: | Line 788: | ||
endif |
endif |
||
alert "I will take ", t ," tokens." |
|||
let h = h - t |
let h = h - t |
||