Let's Make Robots!


Plays Tic Tac Toe, Participates in Oddbot's Naughts and Crosses challenge
TicTacPop.bas8.11 KB
New_Text_Document.txt9.74 KB

UPDATED 2/28/13 Before you read this, please read the post on my other Tic Tac Toe playing robot: The Ttp Project at: http://letsmakerobots.com/node/36073

Skynet was built out of the ashes of The TTP Project, also for the purpose of competing in Oddbot's Naughts and Crosses challenge. I learned sevral lessons from the development of TTP: make the turret secure, make the board unajustable, focus the laser properly, make the laser hit the middle of the baloon, not the middle of the board, and do not use the camera tripod (a real pain to try to film and play at the same time.) All of these things were corrected in this version of the bot, I used sturdy 2" PVC pipe, and bolted it down, I glued the board down, did some experiments poping baloons with various focuses untill I got the best results, and made the laser hit square in the middle of the baloon. Skynet was also made sleeker.

I made the laser turret mount beefer, with two screws on the mounting tabs, and some zip ties and hot glue for good measure.

I took the circut board off of Bonnie, mounted it at the base of the support post, and added a tie LED


 I also rewrote the code to make it better, it now wins 7 out of the 8 possible games, and when the game is over, either points to the squares that made it win, or lights the tie LED for 2 seconds.

Skynet uses the same system for playing as TTP did, when you want to play, you press the power button on the TV remote

Skynet will then go, and just like TTP, always chooses the top left corner. It then waits until you enter what you want to play, pops your baloon, and based on what you pop, pops it's own. This process repeats until either it wins or ties the game. In the video you will notice that the laser stays on for a long time, when mostly the baloons pop immedeatly after it is turned on. I programed this in, because sometimes the baloon will not pop right away, but with a bit of time it will heat up enough to pop. The video shows the Skynet running it's calibration subrutine, and then it playing me in 3 wins and a tie. If you do not move in the centre square right away, it will always win, and even if you do move, you must be careful to not to move in any corner squares afterwards, or it will win again. One of the wins is me purposefully not making an obvious blocking move, to demonstrate that it will win if you fail to block it.

At the time of posting, Skynet is the biggest Tic Tac Toe playing robot entered in Oddbot's contest, and I think I came up with a fairly unique way of coming at the challenge, in closing: Tic Tac Toe is fun right? Popping baloons is fun right? Flipping thru the channels is fun right? building robots is fun right? Now, put those four things together, and it ought to be four times as fun, right? That in a nutshell is Skynet.

As for the name, the laser is kinda up in the sky, and Skynet cannot be beaten in Tic Tac Toe. Maybe it is not such a good idea to have an atonomus robot turret with a high powered laser sitting in my room.......

UPDATE 2/14/13

After a suggestion from my sister, I wraped pink flagging tape around the squares, to make it look more like a grid, and a little easier to follow:

UPDATE 2/19/13==================================================================================

Oddbot has some doubts that my robot is atonomus, so I will try to dispell them in this posting. First, a little background, I have not been programing very long, so when I took on this challenge I decided the best way to program the bot with my limited knowledge would be to start with graph paper, and play out every game possible if the robot started first, and always chose the top left corner. I wrote out 8 starting games all with the X in the top left corner, and then an O in every other possible place, since there are 9 squares in tic tac toe, and my robot already used one of them. In all but one case, the game is straightforward, where once the robot moves, the human MUST put an O in between two Xs. The only game where programing the bot was a bit tricky is where the robot has moved in the top left corner, and the human moves in the centre spot. In this case, the bot will (I think, I am going on memory here, I do not have all my game sheets in front of me.) go in the top right space, this will force the human to move in the top centre space, and then the robot will move in the bottom centre space. There are now 4 unocupied spaces, and it is the human's turn. This required me to do exactly the same thing as with the starting game, namely play out the game from all the possible moves, and program my robot to react to the 4 possible games from there. With my limited knowledge of programing, I took the sheets I had written, and basicly coded a reaction based logic code for the bot. I hope this makes it clear that my bot is indeed autnomous, but if you still have doubts, I can post more detailed pictures of Tic tac toe sheets I wrote (there is one pic on TTP's post), or go thru the code, and play out the games just as I did. the numbers are just starting at one in the top left corner, and going down to either 9 or 18 depending on weather it is the TV remote, or the bot's 18 boxes.

Oddbot, I think if you really look at my code, you will see the robot making it's choices based on inputs, especially if you keep in mind that all the servo coordinates in the pllay subrutine are all for the X boxes and the PF subrutine is all just O boxes. Please have a more detailed look, and read my explinations in the code. I simply chose to use the brute force method of coding it, take EVERY possible game, input it into the chip and have it respond to the playout of the games.

I will now copy and paste my code into the window, and attempt to explain a bit better what is happining in each chunck

UPDATE 2/28/13==============================================================================

HE PLACED!! Skynet now has accomplished both of his goals, playing tic tac toe, and competeing in the challenge. He came in third out of 8, not so bad, and so I will be marking him as complete, and possibly dissasembling in the near future. I also took that rather long code explination/posting out of the way, and put it in an attachment so the post does not look so messy. Skynet was the first robot I have  entered in a challenge, and now I am hooked. expect to see another robot that looks a rather lot like Skynet, but is more just a overly complicated tic tac toe board for two people using a nunchuck.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Thanks for the positive comments guys.

I do not think I will be trying a photonic fence for a while yet, neither my skills or my laser are up to the task of knocking mosquitos out of the air just yet... Even if I did have a laser powerful enough, can you imagine it while it was still being prototyped *Someone walks into room* "What the heck is thaaaaahhhhh MY EYES!!!!! NOOOOOOOO!!!!!!!"

It's original all right, I just wouldn't want to be the one "resetting" the board :P You must have spent a fortune in ballons & this project must have literally left you out of breath :P

One suggestion though, you might consider an overlay that delimitates and makes clear where is each cell. At first glance it's not clear why so many cells, and even afterwards it's a  bit difficult to follow "what's going on". A simple colored paper grid overlay might help with that, or so I believe. :)

Regardless, good work!


The pink tape helps a bit when playing, but I like the idea a lot, I shall see what I can do when I get some time to work on it. Thanks :)

I agree with kariloy...it took me a few minutes to understand what was going on with those extra number of cells.......but Laser popping ballons is really cool..!! Good job.