Post subject: How to win at Tic-Tac-Toe
Former player
Joined: 3/30/2004
Posts: 1354
Location: Heather's imagination
I coded an AI for Tic-Tac-Toe on my Ti-86 that never loses. But instead of giving you its strategy, I'll give you the suboptimal strategy: http://plaza.ufl.edu/aycock/ttt.pdf There is a 100%-effective not-losing strategy, and if your opponent doesn't know it, it translates into about a 70% win rate.
someone is out there who will like you. take off your mask so they can find you faster. I support the new Nekketsu Kouha Kunio-kun.
Joined: 7/14/2004
Posts: 89
Excellent. A+ Now all we need is a tic-tac-toe timeattack. Who can win 100 games in a row the fastest?! Stay tuned!
SWOOOOOOOM
Former player
Joined: 3/13/2004
Posts: 1118
Location: Kansai, JAPAN
I wish I had this information twenty years ago. I would have destroyed my sister with it. We used to play tic tac toe all the time.
Do Not Talk About Feitclub http://www.feitclub.com
Joined: 5/3/2004
Posts: 1203
Lol? You can't be serious. The optimal strategy for TTT is ludicrously simple.
Joined: 3/22/2004
Posts: 95
Howabout optimal 4x4 and 5x5 strategies? 16! and 25! are significantly larger than 9!, but i would think the symmetry of the board would help eliminate some of the possibilities...
Emulator Coder
Joined: 10/9/2004
Posts: 453
Location: Norway
Made a tic tac toe several years ago. It would always draw against itself, win against unsuspecting humans when starting, or always draw and/or win when human started. Not such a big woohoo, just start in a corner, take opposite corner, and if your opponent gets suckered, you have won. Otherwise it's a draw.
Joined: 8/3/2004
Posts: 380
Location: Finland
For bigger boards MinMax -type algorithm would be the best option to base the AI on. One could also try pattern recognition. http://ai-depot.com/LogicGames/MiniMax.html
"Kids! Bringing about Armageddon can be dangerous. Do not attempt it in your home." ( Pratchett & Gaiman: Good Omens )
Former player
Joined: 8/1/2004
Posts: 2687
Location: Seattle, WA
How to win at Tic-Tac-Toe: Don't let opponent get 3 in a row. Get 3 in a row. Dance.
hi nitrodon streamline: cyn-chine
Former player
Joined: 3/19/2004
Posts: 710
Location: USA
Eh, the tic-tac-toe game tree is way to small. A MinMax algorithm is really overkill in such a game. You can do it so fast with it, it's not even worth the time trying to prune the tree. You also probably don't have to look all the way to the bottom. Once you get into 4*4 or 5*5 though, then you would need a clever algorithm. Oh, and ti-89 > ti-86, except for gaming, because ti-86 has bubble bobble.
Joined: 5/3/2004
Posts: 1203
I can't believe you people. "Min-max." "Clever algorithm." "Symmetry of the board." Sheesh. If the requirement is to get Min{n,3} in a row on an nxn board, it is trivial that the player to move first has a forced win in all cases except 3x3. If the requirement is to get n in a row, then the game is obviously drawn for n>2. Go back to playing video games. You will sound a lot less ridiculous.
Former player
Joined: 3/19/2004
Posts: 710
Location: USA
I meant clever as is speeding up techniques. Doing a full traversal of a 4*4 board would take forever using a minmax algorithm. And I didn't really think about what the chances of winning are. I was just commenting on the algorithms. Or do you know of some magic formula to play perfectly with? Try reading people's post next time. You'll sound less like an asshole. Edit: And by symmetry, I guess he means that you only have to consider 1/4 of the possible games, because the other one's are the same but mirrored once or twice.
Editor, Reviewer, Experienced player (968)
Joined: 4/17/2004
Posts: 3107
Location: Sweden
>Go back to playing video games. You will sound a lot less ridiculous. Thanks for again gracing us with your pleasant attitude.
Former player
Joined: 3/8/2004
Posts: 1107
I thought almost everyone knows how to play tic-tac-toe perfectly. It's so simple you can hardly even call it a game. If you want a more complicated tic-tac-toe style game, try playing go-moku. It's played on a 19x19 gameboard and you have to get 5 in a row to win.
Joined: 5/3/2004
Posts: 1203
Bob Whoops: Why yes, I do have a "magic formula" to play with, though it isn't so much a magic formula as it is a painfully obvious strategy that would be naturally and inadvertantly utilized by even a simpleton. How to win TTT on an nxn board where you must get Min{n,3} in a row to win 1x1 and 2x2 are trivial. 3x3 is the one drawable case which is hopefully by now known to everyone. 4x4 is the most general case for all n>3, because if victory is possible on a 4x4 board, then you can pretend any larger board is a 4x4 board by ignoring the extra rows and columns. 4x4: Consider the middle 4 squares. Place an X in NE. If O plays in NW or SE, your next move is to place an X in SW. It should be clear at this point that you are won. If O plays in SW, your next move is to place an X in NW or SE. It should be clear at this point that you are won. Draw in 2nd position in TTT on an nxn board where you must get n in a row to win Find the row, column, or diagonal that has the most of his pieces on it, and none of your own. If there is more than one row, column, or diagonal that meets this requirement, pick one at random. Pick a random square in that row, column, or diagonal. Place your piece there.
Former player
Joined: 3/19/2004
Posts: 710
Location: USA
Seems to work pretty good. >_< Though you still could do a minmax tree >_> Guess I should have actually put some thought into those bigger board problems. Btw, I have some decently hard and interesting problems having to do with some suicide-tictactoe like thing if anyone is interested. It's mostly math and logic though. Oh, and stop with the condescending attitude.
Player (36)
Joined: 9/11/2004
Posts: 2623
Post them please.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Former player
Joined: 3/30/2004
Posts: 1354
Location: Heather's imagination
Gomoku is a pretty fun game but I prefer Pente. Player 1 has a less obvious advantage and you can't just put your pieces anywhere or they'll be captured.
someone is out there who will like you. take off your mask so they can find you faster. I support the new Nekketsu Kouha Kunio-kun.
Former player
Joined: 3/19/2004
Posts: 710
Location: USA
Well, now that I relooked at them, they're pretty much all proofs and calculations x_x You shouldn't attempt that unless you are really good at math. I'll scan them later on.
Joined: 4/25/2004
Posts: 498
Okay...so what about 3-dimensional versions, like the standard 4x4x4? :p
Former player
Joined: 3/19/2004
Posts: 710
Location: USA
3*3*3 is bad because first person easily wins by going in the center. 4*4*4 is technically always winnable by the first person, but not easy enough to do so that humans can still play a decent game no matter who goes first.
Active player (410)
Joined: 3/16/2004
Posts: 2623
Location: America, Québec
The best way to win at tic-tac-toe, is not playing it. What I mean is your losing your time playing this game.
Joined: 8/1/2004
Posts: 162
Phil: Been watching Wargames much? ;)
Love, Ev
Joined: 3/25/2004
Posts: 459
I have played one game of "Ultimate Tic Tac Toe" in my life. And I'll never play it again. My opponent was fierce. The game lasted for 45 minutes. My head was killing me at the end. Even though I was once very into chess, I was not prepared for this game. Essentially, it's a huge Tic Tac Toe board (9 squares.) And in each square is a smaller Tic Tac Toe board. Where your opponent moves on a smaller board is where you need to play your next move. So, if he (in the top left square of the big board) marked the center square, your next turn has to be played in the center square. The object of the game is to have either a Tic Tac Toe on the big board, or more wins of the smaller boards. If you direct your opponent to a square on the big board that's already been completed, he has to option of going anywhere he wants. If you play it, you'll see how complicated it can get.
Post subject: Re: How to win at Tic-Tac-Toe
Former player
Joined: 6/28/2004
Posts: 219
Location: Raccoon City
Boco wrote:
I coded an AI for Tic-Tac-Toe on my Ti-86 that never loses. But instead of giving you its strategy, I'll give you the suboptimal strategy: http://plaza.ufl.edu/aycock/ttt.pdf There is a 100%-effective not-losing strategy, and if your opponent doesn't know it, it translates into about a 70% win rate.
whoa whoa whoa, boco? you go to UF too? its a small world after all. im a freshman living in 420 hume west. p.s. i used to know how to use the ufl ftp without using WS_FTP. can you pm me and refresh my memory as to how to use it?
Former player
Joined: 2/5/2005
Posts: 44
Location: Germany
Ramzi wrote:
I have played one game of "Ultimate Tic Tac Toe" in my life. And I'll never play it again. My opponent was fierce. The game lasted for 45 minutes. My head was killing me at the end. Even though I was once very into chess, I was not prepared for this game. Essentially, it's a huge Tic Tac Toe board (9 squares.) And in each square is a smaller Tic Tac Toe board. Where your opponent moves on a smaller board is where you need to play your next move. So, if he (in the top left square of the big board) marked the center square, your next turn has to be played in the center square. The object of the game is to have either a Tic Tac Toe on the big board, or more wins of the smaller boards. If you direct your opponent to a square on the big board that's already been completed, he has to option of going anywhere he wants. If you play it, you'll see how complicated it can get.
I soooo want to play that.