Lego NXT: Tic-Tac-Toe Playing Robot

en.pdf24.org    Send article as PDF   
LEGO Mindstorms NXT Tic-Tac-Toe (Naughts & Crosses) Playing Robot was programmed with NXC, using Daniele Benedettelli‘s ‘AI‘ Code. The Robot uses a Hitechnic Colour Sensor to detect the coloured balls placed on the Game Board. The robot’s ability to detect the correct colour of the balls, is far superior when using the Hitechnic Colour Sensor than trying to use the standard LEGO Light Sensor.

LEGO Mindstorms NXT TicTacToe (Naughts & Crosses) Playing Robot
Lego NXT: Tic-Tac-Toe Playing Robot

The game of Tic-Tac-Toe is also known as noughts-and-crosses, hugs-and-kisses and by many other names around the globe. The game requires two players, ‘O’ and ‘X’, alternatively drawn on a 3×3 Matrix or Grid. The player who manages to place three of their marks in a horizontal, vertical or diagonal row wins the game.

The game has 3 difficulty levels starting with ‘Novice’ that places balls at random. Next is ‘Normal’, followed by the almost impossible ‘Expert’ level. Once you’ve played the game a few times, you will realise that when played at an optimal skill level by both you and your opponent , the game always ends in a Draw!

LEGO Mindstorms NXT TicTacToe (Naughts & Crosses) Playing Robot
Lego NXT: Tic-Tac-Toe Playing Robot

The Tic-tac-Toe Playing Robot uses one motor to rotate the Game Board, another to move the Arm carrying the Ball Hopper linearly over the Game Board, and a third drops the Ball from the Ball Hopper onto the Game Board.

The Rotating Game Board has nine spaces in a 3×3 matrix to place the balls on different colours in. The Blue Balls are used by the Robot, with the Yellow one for the human opponent.

LEGO Mindstorms NXT TicTacToe (Naughts & Crosses) Playing Robot
Lego NXT: Tic-Tac-Toe Playing Robot

The Robot can reach all the cells in the 3×3 matrix by rotating Game Board through 45 degree increments and by sliding the Ball Hopper backwards-&-forwards.  The Hitechnic Colour Sensor on the end of the Ball Hopper detects where the human opponent has placed a Yellow Ball. The Robot drops it’s Blue Balls from the shoot via a double-action slider mechanism that only allows on Ball at a time to drop.

LEGO Mindstorms NXT TicTacToe (Naughts & Crosses) Playing Robot
Lego NXT: Tic-Tac-Toe Playing Robot

Combinatorial Game Theory:

The Tic-Tac-Toe playing robot relies on Combinatorial Game Theory for the “AI” or Artificial Intelligence aspect of the software. Combinatorial Game Theory studies strategies and mathematics of two-player games of perfect knowledge such as chess or go (but often either concentrating instead on simpler games such as nim, or solving endgames and other special cases). An important distinction between this subject and classical game theory (a branch of economics) is that game players are assumed to move in sequence rather than simultaneously, so there is no point in randomisation or other information-hiding strategies.

See Wikipedia for details of Combinatorial Game Theory and links to further relevant information…..

 

Need-More-Bricks

Previous Post

Rechargeable 2.4Ghz Wireless Camera

I brought this Hamy, 2.4Ghz Wireless 1/3 Sony CCD Rechargeable Camera to use with my Robots. It has a Sensitivity: of 0.5 Lux at F1.2, which makes it great for ... Read more

Next Post

New NXTBee Radio Modems for the NXT

A pair of NXTBee Radio Modems for use with my LEGO Mindstorms Robots, arrived late this afternoon from Dexter Industries in the United States. I've been waiting for a while ... Read more

Short URL: http://tinyurl.com/z89g8bl

Leave a Reply

Your email address will not be published. Required fields are marked *



Do NOT follow this link or you will be banned from the site!
error: Content is protected !!