RosettaCodeData/Task/Nim-game/PureBasic/nim-game.basic

20 lines
560 B
Plaintext

OpenConsole()
Define monton.i = 12, llevar.i
While monton > 0
Print("There are " + Str(monton) + " tokens remaining. How many would you like to take? ")
llevar = Val(Input())
While llevar = 0 Or llevar > 3
Print("You must take 1, 2, or 3 tokens. How many would you like to take ")
llevar = Val(Input())
Wend
PrintN("On my turn I will take " + Str(4 - llevar) + " token(s).")
monton = monton - 4
Wend
PrintN("I got the last token. I win! Better luck next time.")
PrintN(#CRLF$ + "--- terminado, pulsa RETURN---"): Input()
CloseConsole()