It works and all, but no tic tac toe program like this should be 2000 lines long. You can put a lot of the stuff you have into specific functions. You repeat yourself many times, and basically just hardcoded the game. This will work for a simple game like tic tac toe, but if you wanna progress farther as a programmer you need to actually learn how to program.
I was a bit surprised when a tic tac toe program took 2600+ lines of code, no tic tac toe should be that long. Also it generated 646 lines of code, and "Impossible" isn't really impossible(It's beatable in 3 moves)
I beat the impossible level in 3 moves!
and beat it on first try!
Nice job! Enjoyed playing.
This is REALLY cool. I think it would be better if it was more obvious where the player "0" plays because I sometimes can't tell if the bot played in a spot or if it's just the number zero.
Hi Cyan. That computer is quite polite. It won, with three o-s in a row, but let me place anothr x after winning. So I also got 3 in a row. The computer then told me that I had won the game. REALLY! There must be a bug in this game somewhere...
@microwither The strategy used to beat the impossible computer is to choose a corner, then the opposite corner, then a third corner (or the middle if the computer has left it open). The way for a computer to tie a game that opens this way is to choose the corner opposite the one the player chose on the first move. From there, all the computer has to do is block any potential 3-in-a-row moves.