Introduction: Ultimate Tic Tac Toe is a variant of the popular game of Tic Tac Toe. It consists of one large Tic Tac Toe board, and in each square, there is a small Tic Tac Toe board. Each square on a small board corresponds to one of the small boards. For example, the center square of any given small board corresponds to the center board, and the top-left square of any given small board corresponds to the top-left square. This will be useful to note while playing.
Rules: The rules are similar to those of regular Tic Tac Toe, but, of course, modified to fit the game.
- X always goes first
- No two symbols can share the same square
- On X's first turn, they can choose to play in any of the small boards.
- After that, the square of the small board in which the last player played corresponds to the square in which the next player must play. For example, if X played in the bottom-right square of the center board, O would have to play in the bottom-right board.
- To win in a small board, you must get three of your symbol in a row in that board, including diagonals.
- If a small board completely fills up and/or if someone wins in a small board (gets 3 in a row in it), it is considered "closed" and no one can play in it for the remainder of the game.
- If a small board is closed by a draw, no one can use it. It cannot help any player win, nor can it contribute to a draw, win, or loss on the large board.
- If anyone is told to play in a "closed" small board by rule 3 gets to play in any "open" small board they want. For example, if O plays in the top-middle square of the bottom-left board, but the top-middle square was already won by O, X, instead of needing to play in that board, can now play in any board of their choosing. This applies no matter who won the board or whether it was closed by a draw.
- To win the game, you must win three small games in a row, including diagonals.
- If all 9 small boards have been closed and no player has 3 of their closed games in a row, the game is considered a draw. There is a tie-breaker rule in the original game, but in my terminal-based implementation of it, I removed it because I didn't think it was a good tie-breaker rule.
How to Play (using my python implementation): If you wish to play against a bot, you must download the UTTT_bot.py file as well and you must put it in the same folder as UltimateTicTacToe.py First, the code will prompt you to press enter to start. It doesn't matter what or if you type there, as long as you press enter. Then, it will ask whether you want to play against a friend (local multiplayer) or against a bot (Please note that this bot is a major work-in-progress and will almost certainly crash mid-game in its current state). Type "friend" to play local multiplayer or type "bot" to play against a bot. If you choose to play against a bot, it will ask you a few questions based on the bot. It will ask about depth. That is how many moves into the future it should look to evaluate the best move. Higher numbers make the bot harder to beat, but it takes longer for the bot to calculate. Then, it will ask which symbol you would like it to play as. This should be pretty self-explanatory. A square is represented by 1 character, and I only drew the grid lines of the large square. To help you see each individual square, I used a '/' to denote an empty square instead of a space or any other character. If a square shows a number, that is to help with square selection. If a square is a forwards slash ('/'), that means it is empty and anyone can claim it when the rules say that they can. If a square is an X or an O, that means that the corresponding player has marked that square. If a small board has ASCII art that looks like a large X, then X has closed that small board by getting a 3 in a row on it. If a small board has ASCII art that looks like a large O (minus alignment issues and it being closer to a long octagon and it having double quotes at the top), then O has closed that small board by getting 3 in a row on it. If a small board is blocked out by rows of equals signs ('='), that means that game has been completely filled up and no one has won in it. Do not confuse O's for 0's. There are no 0's printed to the terminal, so if you see something that looks like a 0, it's actually an O. This might just be me who found it slightly less easy than desired to tell an O apart from a 0, but if it isn't, this is your warning. Remember that an O (letter) has a hollow middle, but a 0 (number) has a slash going through it (at least that's how it is in the terminal and here). When it asks you for where you would like to play, pay attention to the board and the text in parentheses. If the text in parentheses says 'board number', it is asking which board you would like to play in. Look at the large board, then at the small board in which you would like to play. Find a number in it. Whatever that number is, it is the board number. Type that at the prompt and hit enter, and it will prompt you for a square number. If the text in the parentheses says 'square number', it is asking for the square in which you would like to play. It implies that the board has already been selected. Look for a board that doesn't have slashes ('/'). It should have numbers in it. Find the square you would like to play in, and type that number at the prompt, then hit enter. Again, do not confuse O's for 0's. I know some people might forget, which is why I am saying it twice. Do not confuse the two. You can't blame me if you do mix up an O for a 0, since I did warn you twice.
Game tips:
- Always think a few moves ahead.
- Although placing your mark in an edge square is bad in regular Tic Tac Toe, it is not as bad in Ultimate Tic Tac Toe, since it is a somewhat good strategy to send your opponents to the edges.
- Remember that if you see something that looks like a 0, it's an O. This is your third and final warning.
- The minuses ('-'), plusses ('+'), and vertical bar/pipe ('|') seperate the small boards, but nothing seperates the squares. You have to use the slashes to help you figure out where one square ends and another begins.
- If you encounter a bug, please report the bug and tell me how to recreate it.
- Have fun!
Why I Made This: I was on a trip and wanted to play Ultimate Tic Tac Toe. However, I didn't know where I could play it. Then, I realized I could simply code it in Python. After some coding and playtesting, I had a finished result. However, I wanted to make a bot so I didn't have to ask someone to play against me every time I wanted to play. Because of this, I coded a bot using a minmax algorithm. It wasn't perfect (far from it, actually), and it did crash too often, but it was mine, and I was somewhat proud of it. It's still a work-in-progress, and I will constantly be trying to improve it.
Known Issues:
- The bot crashes too much. I don't know what exactly causes a crash, but it happens every game, pretty early on. I will need to play against the bot more to see what exactly causes the crash.
Planned Updates:
- Fix the bot crashing issue
- Add a Super Ultimate mode with 1 big, 9 medium, and 81 small boards (maybe)
- Improve the bot