A robot to play tic-tac-toe

This robot is playing alone with a man in the classic (3 x 3) tic-tac-toe.

The game is simple, like myself, the robot built out of LEGO-NXT. «Self» means that the robot can determine what kind of made people take a decision and make a retaliatory move. This person does not have a direct impact on the robot, ie no clicks, for example, the control buttons.

Game board is made up of a further detail of the same designer of LEGO, as a «dagger» and «noughts» using appropriate size pieces of two colors (for a white person necessarily, for better recognition of the robot).

The design involved all 3 engine, part of the set. Two of them – to move the carriage over the playing field, and the third – a mechanism for managing emissions checkers using traction cable. On the carriage is an active light sensor for determining the presence of the white pieces in the box game, and store at 5 checkers that «charged» before the game. Moreover, the limit switch, a mechanism to bring in original condition and the sound sensor to feed the robot voice commands like «let’s go, plastic block!».

When you start the program, the robot leads servomotor to its original state, resets the counters, the situation and invites the person to make his move. A man puts a bomb in one of the cells and provides a sound command the robot. Using rooted in memory, information about the location of cells playing field, the robot positions the carriage with a light sensor on each of the cells identified in the memory as free at the moment, in search of the white pieces, had not yet determined what kind of people did. Then, the robot decides on its response, taking advantage of a winning strategy, and introducing some variety into the game with the help of random number generator. Now the robot is to place the carriage on the selected unit, reset it to bomb and leave in the original position to open the playing field for the next turn right.
Continue reading