Share your repls and programming experiences

← Back to all posts
My unbeatable game of Nim
Jfcbartlett (1)

I made this game for the a.i. challenge but I found out about it too late so I want to know what you think of my code as I’m a beginner

Is there anywhere I can improve my code?

tiki720 (52)

you should try to make a version with only 1 game loop and you get to choose the winning number

Jfcbartlett (1)


do you know how to fix the problem that I have
when you win it says you win but then it continues and says I win and then ends

tiki720 (52)

I'm not very good at python, but I re-wrote it so the computer always wins.

tiki720 (52)

@Jfcbartlett \n means newline, you can put it instead of using print(" ") each time you want to space lines out. e.g
print("first line\nsecond line")
instead of
print("first line")
print("second line")

I must have made a typo when I wrote /n