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

18 lines
447 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
monton = 12
llevar = 0
DO WHILE monton > 0
PRINT USING "There are ## tokens remaining. How many would you like to take"; monton;
INPUT llevar
DO WHILE llevar = 0 OR llevar > 3
2026-04-30 12:34:36 -04:00
INPUT "You must take 1, 2, or 3 tokens. How many would you like to take"; llevar
2023-07-01 11:58:00 -04:00
LOOP
2026-04-30 12:34:36 -04:00
PRINT "On my turn I will take"; 4 - llevar; " token(s)."
2023-07-01 11:58:00 -04:00
monton = monton - 4
LOOP
PRINT
PRINT "I got the last token. I win! Better luck next time."
END