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,22 @@
function nimgame()
tcount = 12
takenum = 0
while true
while true
permitted = collect(1:min(3,tcount))
println("$tcount tokens remain.\nHow many do you take ($permitted)? ")
takenum = parse(Int, strip(readline(stdin)))
if takenum in permitted
break
end
end
tcount -= 4
println("Computer takes $(4 - takenum). There are $tcount tokens left.")
if tcount < 1
println("Computer wins as expected.")
break
end
end
end
nimgame()