Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Nim-game/PureBasic/nim-game.basic
Normal file
19
Task/Nim-game/PureBasic/nim-game.basic
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue