Tic Tac Toe AI

Honestly im surprized no one made this yet. Its extremeley simple. I even made one on google sheets

Cool project!

thanks. im working on connect 4. i already have it made in google sheets

Did you use min/max algo?

no. but for the connect 4 im working on i am

This is the best part:
tic tac toe AI script pic

Why do you call it an AI? It seems to have an algorithm built in.

Nice that it understands 1-9 etc as problematic.

Also nice that it understands isomorphism under board rotation. But I think you should have to check that only once, the first time someone moves anywhere but the middle square. Then just remember which rotation you're in. No?

no. the board rotation prevents from checking 4 times the amount of cells i need to check because it doesnt view it is a human its a string input

don't forgot to remove draggable !

One of us isn't understanding the other. Or maybe both. :~)

I understand what the board rotation is for. But I think you check the different rotations repeatedly as the game goes on, and I'm arguing that you could pin it down as soon as someone moves anywhere but the center, because then the board is no longer rotationally symmetric.

I managed to place four pieces at once

i only check the board rotation if the player is first and its the 3rd move. so i am only checking it once

Ah, okay, sorry! I misread that.

I accidentally found this while playing

I placed two X-pieces at once by clicking an edge between two squares.

Also I accidentally dragged the squares. You can turn it off by disabling "draggable" for the square sprite

With this trick you can also place 4 x's at once by pressing the corner of each square. :joy:
This allows you to cheat.
Ten 46 Surprised


how do i fix it

Don't make the box sprites touch/overlap each other, increase the distance.

nope i want it to look like that. i found a dif way to fix it

Add an allow variable, set it to true on green flag, then change your code to this:

Also, don't use empty else, as it adds a ~16.666ms delay.
Nevermind, you fixed it