Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,20 @@
print("There are twelve tokens.")
print("You can take 1, 2, or 3 on your turn.")
print("Whoever takes the last token wins.\n")
var tokens = 12
while tokens > 0 {
print("There are \(tokens) remaining.")
print("How many do you take?")
var playertake = Integer(readLine())
if playertake < 1 || playertake > 3 {
print("1, 2, or 3 only.")
} else {
tokens -= playertake
print("I take \(4 - playertake).")
tokens -= (4 - playertake)
}
}
print("I win again.")