Jump to content

Nim game: Difference between revisions

Line 1,136:
<syntaxhighlight lang="basic">title "NIM"
 
let h = int: (rnd) * 12 + 12
 
label loop
Line 1,149:
endif
 
letif ht <= h3 -and t >= 1 then
 
if let h = 0h - thent
 
if h = 0 then
alert "Congratulations. You got the last token."
end
 
alert "Congratulations. You got the last token."
endif
end
 
endif
let t = 4 - t
 
let t = 4 - t
print "I will take ", t ," tokens."
let h = h - t
 
let if h = h -0 tthen
 
alert "I got the last token. I win. Better luck next time."
if h = 0 then
end
 
endif
alert "I got the last token. I win. Better luck next time."
end
 
endif
305

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.