Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

ES450 Tic-Tac-Toe Robot

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
98 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Dec 7, 2010

This project was designed by MIDN 1/C Jason Senko and MIDN 1/C Amy Lowe, both Systems Engineers and the US Naval Academy. The ScorBot was used along with a USB camera to play a game of tic-tac-toe with a user. The user will click on a board on the screen, which the robot will then move their piece on the playing board. After the robot has moved the user's piece it will then move its own piece on the board. After each move, the computer will assess the board to check if either player has won. If the user wins, the robot will pout, but if the robot wins, it will celebrate. We assume the board will always be in the same place. We will have a place, the Loading Zone, that all pieces are picked up from. The board is laid out with thick, easy to see lines. The blocks are different size and colors for the different players.

The code used use a set of several functions to determine the right move and where to move the ScorBot. The main code would start off by choosing a random first player. The name of the player would then be posted on the screen ("user" or "computer"). If it is the user's turn, the board is printed on the computer screen with a cross-hair. If the move the user picks is found to be valid, the ScorBot will use the command ScorCartMove to move the block to the proper position. The computer will then pick a valid move and the game will go on like such.

One function in the code is a series of 'if' statements that will help the robot pick its next move. Another function is designed to determine if the move is valid. Another function will move the robot in such a way that it celebrate if it wins, pout if the user wins and will trace a 'C' for 'cat' in the event of a tie.

Category:

Science & Technology

Tags:

License:

Standard YouTube License

Link to this comment:

Share to:
see all

All Comments (0)

Sign In or Sign Up now to post a comment!
Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more