Skip to content
Sign upLog in
← Back to Community

Tic Tac Toe Bot

Profile icon
smwhalen94

Here is a tic tac toe game that allows you to both verse another human or an AI. The AI uses the randint algorithm to determine what space it will choose, so sometimes you will be able to beat the AI but other times it will be impossible! I also have implemented the play board using turtle so you can see where you and your opponent have gone. I also added a little easter egg in AI mode, see if you can find it and Good luck beating the AI! Have Fun !

https://repl.it/@smwhalen94/AI-Tic-Tac-Toe

Voters
Profile icon
karagozabdullah
Profile icon
JAIVISHNUM
Profile icon
smwhalen94
Profile icon
JOSHUAKONDUR
Profile icon
MichaelMutunga
Profile icon
OscarMarret
Profile icon
10780
Profile icon
bonnie31909
Profile icon
ash15khng
Profile icon
IbenPolanco
Comments
hotnewtop
Profile icon
Barry123

Computer goes first all the time

Profile icon
smwhalen94

@Barry123
I tried it out myself and it is random, looks like you just had the luck of the computer going first for the games you played.

Profile icon
Barry123

It said I lost when it was a tie

Profile icon
smwhalen94

@Barry123
I fixed the issue where the computer thinks it wins when there is actually a tie

Profile icon
cgorji19

What is this dumb poo

Profile icon
smwhalen94

@cgorji19
I always wondered what a nine year old would say if they ran my code.. Now I know! Thanks Gojira ;)

Profile icon
oignons

@cgorji19
please don't be mean, this person took time to create this.

Profile icon
Robodahobo

jks its good

Profile icon
smwhalen94

@Robodahobo
lol. Thanks man!

Profile icon
Robodahobo

meh

Profile icon
dartain123

nice

Profile icon
smwhalen94

@dartain123
Thanks !