A list of puns related to "Tic tac toe variants"
I saw this posted to /r/holdmyjuicebox and I was wondering if anyone has figured out the optimal strategy as X and O for tic-tac-toe played this way (without the running back and forth part).
So just to be clear, the rules are as follows:
Pocket Ops is a quick little tic-tac-toe variant released by the Grand Gamers Guild. I picked up the game and liked the little charm of it and quickly realized this was a small enough game that I could write a program to find the optimal solution. I thought it would be fun so I wrote it up and I thought you guys would be interseted in the results!
I wrote two programs PocketOps_Analysis and PocketOps_Play. PocketOps_Play lets you play against the computer using optimal strategy for the game. PocketOps_Analysis lets you enter moves manually and shows you the score for the current position and the probability that the optimal AI will move for each square. You can find the code on Github and if you want to run the code you can just copy and past it into an online Python interpreter such as Repl.it.
Game Rules:
Pocket Ops takes place on a 3x3 grid where players take turn placing their pieces on the board and first player to place 3 in a row wins! The main premise behind pocket ops is that before a player makes a move their opponent gets an opportunity to secretly pick a square to block. If the player plays at the square that their opponent chose to block they do not get to place their piece on that square. So do you avoid playing in the really good square because your opponent will surely block it? But if they know you won't go there maybe they'll block the second best square and you should play at the best square!
The game also comes with special abilities that you can use once per game that let you do things like destroy an opponent's piece or move another piece already placed. I didn't include these in the analysis but that would be doable in the future.
Finally one major thing about the rules is that the games states that a draw counts as a win for the player going second. The game is drawn if there is only one square that is unoccupied and no player has won yet. You can turn this rule off and count draws as 1/2 point for each player in the programs by changing the ties_allowed variable to True. This greatly affects the outcome of the game and we'll analyze this design decision.
Methods:
A description of the techniques used in the programs can be found here.
Results:
If draws count as a win for the second player then the first player on
... keep reading on reddit β‘Hi, dev here, well one could say i keep the legacy of the vision the original devs had.
So, as far as i know the game was originally planned to be divided into 3 parts, each one focusing on one of the main aspects of the game (tic, tac, and toe), however since the creators had an inexplicable fobia to the number 2 , this was never posible and we were left with what we now know as Tic-Tac-Toe. Having realized that the 2 missing updates would never come out, i was decided to create my own version.
Now of course, first i had to choose an aspect of the game, which ended up being the Tac aspect of the game due to the fact that, at least according to my investigations, the toe aspect of the game is deviant to say the least. Given that this mode concentrates in Tac, it is by nature much less practical and less explicitly aggressive. With out further ado, lets talk the rules in question:
ACTUAL RULES START HERE
Name:Epistle 2/Tac update/ Deduction Tic-Tac-Toe
Grid:4x4 (can be imaginary, with coordinates for pro gameplay)
Materials: 16 pentomino cards, and 16 coordinates cards.
Players:2
Setup:Give each player 1 random pentomino card (must be secret to the other player), then proceed to give each player 4 random coordinate cards(must be secret to the other player).
How to: Each turn both players take a coordinate card and put in on ther respective side facedown (they can look at it at any momment) and then give the remaining cards to the other player. Once each player has taken 4 coordinate cards, the process is repeated with the remaining 8 cards.
Winning: At the very momment a player manages to collect all the coordinate cards needed to recreate his pentominoe (can be turned around in any non-diagonal direction but not mirrored), the game stops and said player wins.
Competitive specifications: 3 games, if a draw occurs, keep playing until a player wins.
Pentomino reference: https://upload.wikimedia.org/wikipedia/commons/thumb/a/aa/All_18_Pentominoes.svg/1200px-All_18_Pentominoes.svg.png
...and call them... well, I don't really need to say it, do I?
Tactics.
I posted on this subreddit asking for help on a tic tac toe game that was 3642 lines of code and I got flamed (in a good way).
Thank you.
I had sculped an effigy of inefficiency and I have been ushered into the world with a fresh perspective. I did my best and reduced the code by a factor of 10 to 380 lines of code. It most likely can be cleaned up further but it did the job.
Here's the code. I believe it is impossible to beat. Give it a try, if you win tell me.
Thanks for the help guys.
After completing Tic Tac Toe recently I decided to code Battleship after my girlfriend said it would be too hard.
I will first explore what I learned, then use that knowledge to explain why I believe Battleship would be an excellent choice after programming Tic Tac Toe.
What I learned.
Why you should code Battleship after Tic Tac Toe.
Expansion of previous knowledge:
Opportunities to learn new things:
Fun!
Questions to ask yourself.
def tic_tac_toe():
print(" | | ")
print(" 1 | 2 | 3 ")
print(" _____|_____|_____")
print(" | | ")
print(" 4 | 5 | 6 ")
print(" _____|_____|_____")
print(" | | ")
print(" 7 | 8 | 9 ")
print(" | | ")
a1 = "1"
a2 = "2"
a3 = "3"
b1 = "4"
b2 = "5"
b3 = "6"
c1 = "7"
c2 = "8"
c3 = "9"
x1 = input("witch spot")
x1 = int(x1)
if int(x1) == 1:
a1 = "x"
elif int(x1) == 2:
a2 = "x"
elif int(x1) == 3:
a3 = "x"
elif int(x1) == 4:
b1 = "x"
elif int(x1) == 5:
b2 = "x"
elif int(x1) == 6:
b3 = "x"
elif int(x1) == 7:
c1 = "x"
elif int(x1) == 8:
c2 = "x"
elif int(x1) == 9:
c3 = "x"
else:
print('bad value')
exit()
def draw_tic_board(a1='-', a2='-', a3='-', b1='-', b2='-', b3='-', c1='-', c2='-', c3='-'):
print(" | | ")
print(" " + a1 + " | " + a2 + " | " + a3 + " ")
print(" _____|_____|_____")
print(" | | ")
print(" " + b1 + " | " + b2 + " | " + b3 + " ")
print(" _____|_____|_____")
print(" | | ")
print(" " + c1 + " | " + c2 + " | " + c3 + " ")
print(" | | ")
board = draw_tic_board(a1=a1, a2=a2, a3=a3, b1=b1, b2=b2, b3=b3, c1=c1, c2=c2, c3=c3)
o1 = input("next player")
o1 = int(o1)
if o1 == x1:
print("alredy taken")
exit()
elif int(o1) == 1:
a1 = "o"
elif int(o1) == 2:
a2 = "o"
elif int(o1) == 3:
a3 = "o"
elif int(o1) == 4:
b1 = "o"
elif int(o1) == 5:
b2 = "o"
elif int(o1) == 6:
b3 = "o"
elif int(o1) == 7:
c1 = "o"
elif int(o1) == 8:
c2 = "o"
elif int(o1) == 9:
c3 = "o"
else:
print('bad value')
exit()
board = draw_tic_board(a1=a1, a2=a2, a3=a3, b1=b1, b2=b2, b3=b3, c1=c1, c2=c2, c3=c3)
x2 = input("next player")
if x2 == x1 | o1:
... keep reading on reddit β‘tl;dr I developed AI solution (MCTS + NN) inspired by AlphaZero for playing Ultimate Tic-Tac-Toe game in the browser. You can try it yourself here: https://uttt.ai.
Why?
Ever since I started working in Machine Learning 5 years ago, I have always wanted to do some cool project for my portfolio. Reading scientific papers gave me plenty of ideas, but only after I read AlphaZero preprint I knew: this is it!
AlphaZero is a third paper in AlphaGo, AlphaGo Zero, AlphaZero, MuZero sequence. In AlphaZero paper Deepmind generalizes previous work so that AI can learn through self-play not only how to master Go, but also Chess and Shogi. I had read previous papers, but it was AlphaZero specifically that sparked my imagination. Probably because I love simple and elegant engineering solutions and AlphaZero is mostly about that.
I discovered Ultimate Tic-Tac-Toe and implemented AlphaZero in early 2018. After a few weeks of work I realized it's not going to be an easy ride. There were two major problems that essentially made me forget about this project for a long time.
Firstly, although Ultimate Tic-Tac-Toe (UTTT) looks easier than Chess or Go, it is still quite a challenging game. The average length for UTTT game is somewhere between 40 and 50 plies. The average number of legal actions per position is somewhere around 7 (my estimate from self-play data). It is difficult setup for a side-project. One of the key factors enabling AlphaZero success is massive computing power (5000 TPU v1 for self-play and 64 TPU v2 for training). I had to figure out much cheaper way to develop interestingly good AI under my personal budget.
Secondly, when I envisioned deploying AlphaZero in the browser I had zero knowledge of web development and frontend in general. Which meant I had to find some time to learn it. Not easy if you already have a full-time job and other stuff going on in your life. I decided to put the whole project on hold and said to myself: "maybe one day there will be better time for this..."
Fast-forward to 2021. I left my job and decided to spend a year on a career break, pursuing my interests. I realized that I finally had enough time and resources to conquer this project. I learned the basics of web browsers, HTML, CSS, JavaScript and React. I bought a desktop PC. I've managed to incrementally redesign AlphaZero self-play training into something more executable on my co
... keep reading on reddit β‘iβve been looking for weeks and had no luck. and if anyone knows someone who could help me thatβd be good too, any help is appreciated and thank u in advance
Hi all
I have completed tic tac toe for The Odin Project and would appreciate any feedback you might have.
GitHub: https://github.com/parradam/tic-tac-toe
Live demo: https://parradam.github.io/tic-tac-toe/
Any thoughts or advice would be much appreciated. Thank you!
After completing Tic Tac Toe recently I decided to code Battleship after my girlfriend said it would be too hard.
I will first explore what I learned, then use that knowledge to explain why I believe Battleship would be an excellent choice after programming Tic Tac Toe.
What I learned.
Why you should code Battleship after Tic Tac Toe.
Expansion of previous knowledge:
Opportunities to learn new things:
Fun!
Questions to ask yourself.
Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.