Skip to content
Sign upLog in
← Back to Community
Unbeatable Tic Tac Toe
Profile icon
TrentBultsma

To play, use the numpad to select your square and try to get 3 X's in a row. You will not win a game of tic tac toe against this AI. But if you do, please leave a comment with the moves you used so I can fix it. Here is a layout of the board if you don't have a num pad or are confused how that works:
7 | 8 | 9

4 | 5 | 6

1 | 2 | 3

Voters
Profile icon
LordPancake
Profile icon
Murzikal
Profile icon
CollinKunsman
Profile icon
lukel_lv
Profile icon
NoahGomes
Profile icon
coder787878
Profile icon
ElliotEsposito
Profile icon
LesleyRazzaghia
Profile icon
ash15khng
Comments
hotnewtop
Profile icon
Willthe

Drew 73294

Profile icon
launcherman08

Hey, nice job! Haven't been able to beat now!

Profile icon
KatharineChavez

This file cannot be displayed: https://storage.googleapis.com/replit/images/1550007012108_bf1d185f172cd3b6b2b48248e697cd73.gi
cool game good work.

Profile icon
MegaGiratina

i beat it i simply put 5 then 6 then 1 then 2 then 3

Profile icon
TrentBultsma

@MegaGiratina

This file cannot be displayed: https://storage.googleapis.com/replit/images/1549809825340_9eb845aad489f936c0cd7b230f31554a.pn
Are you sure because I lose when I do that

Profile icon
YeetMstr
Profile icon
ShivrajNag

@TrentBultsma
Does this AI make same moves for a particular set of player's input???

Profile icon
Stanlyhalo

Guys you do realize every time you comment a win with instructions, he will fix it so that won't work, right?

Profile icon
PowerCoder

TrentBultsma made a more user friendly version of your game. The link to it is
Repl_Game_link_Click. You seem like you know what your doing in python. The remix includes colors, clearing the console . So that the console doesn't get crowded. It also tells you all the moves you did in order at the end of the game. You did waaaaaaay better than I could do in making a tic-tac-toe A.I game
This file cannot be displayed: https://storage.googleapis.com/replit/images/1560350654960_b07245db7cc166d1d73dd61c5f20c842.pn

Profile icon
ash15khng

Now can we make this play itself?

Profile icon
Shinnie

i won! just put 5, then 6, then 1, then 2, then 3!!!

Profile icon
Stanlyhalo

@Shinnie
Doesn't work.

Profile icon
ALEXANDERWATTS

Didn't loose but didn't win nice game

Profile icon
CharlieBolger

its not unbeatable, i beat it first try

Profile icon
hhhggg

This game is guaranteed to tie every time if every move is perfect

Profile icon
JuanCarlos32

Welp, the nearest solution to win is to tie

Profile icon
[deleted]

It is unbeatable because it is an AI that doesn't get distracted.
Any game where both sides try will end in a tie

Profile icon
programmyBoi

This AI is cool. I can't beat it, but I can definitely tie with it!

Profile icon
TrentBultsma

@programmyBoi
A perfect game of tic tac toe always ends in a tie

Profile icon
CharlieMorris1
Profile icon
1Ethan

Very nice, still haven't beat it yet. Must be doing something right...!

Profile icon
Unfortunately

so close! tie
This file cannot be displayed: https://storage.googleapis.com/replit/images/1549646595738_78529e37f8f9d3b025c773fa52b9c674.pn

Profile icon
Unfortunately

um the number input is really hard to understand

Profile icon
TrentBultsma

@Unfortunately
If you have a number pad on the side of your keyboard, the spots correspond to the numbers on that. If you don't, there is a helpful diagram in the description at the top.

Profile icon
TristinKeenan

0 | X | X

X | X |

0 | 0 |
It did this then froze

Profile icon
TristinKeenan

Um. I beat it

Profile icon
TrentBultsma

@TristinKeenan
what moves did you use?

Profile icon
COLEROBINSON

3897

Profile icon
TrentBultsma
Profile icon
TrentBultsma

All wins below this post are fixed, continue bug testing. Your help is much appreciated

Profile icon
launcherman08

Same as me

![Screenshot 2019-02-06 at 3.23.12 PM]
(https://storage.googleapis.com/replit/images/1549495442705_0ee76830b8917eb62380c6b747ac1253.pn)
Take the L, AI!

Profile icon
launcherman08

@launcherman08
Also, I did it on a chromebook!

Profile icon
UphillBrush

This file cannot be displayed: https://storage.googleapis.com/replit/images/1549487220798_df781b92a383608277aefbffdaa43fd2.pn

I win! yay!

Game:
Me: 5 AI: 7
Me: 3 AI: 8
Me: 9 AI: 6
Me: 1 AI: 2
End of game

Profile icon
launcherman08

@UphillBrush
Also won, check comment above on the page

Profile icon
AllAwesome497

Beat it
This file cannot be displayed: https://storage.googleapis.com/replit/images/1549482765079_0283f6553ba79c98a79d8b3e70e03021.pn

Profile icon
TrentBultsma

@AllAwesome497
what turns did you do?

Profile icon
TrentBultsma

never mind, I figured it out and am working on a fix

Profile icon
abc3354

Cool !