TAR - Tactical Robot.

[ Quite C ]

Introduction
What's new
CONNECT-3
Software
Hardware
Photo
Version history
Files

Francesco Ferrara in a game with his TAR Robot
(the robot win!)

INTRODUCTION

I have programmed a Robot (made with Lego(R) Mindstorms) to play a game that is similar to connect-4.

If you want to see it in action: taranim.gif (284Kb)

Do your move and press the run button, the robot move to scan the board, think to the best move and put a white men on the board without your help!!!

My program play this game (connect-3) very well! After 5 days I collected 32 game lost and two victory!
This is TAR, tactical robot the most complex game made with lego. This is a very large and complex projects for me, I have spent a lot of time to build this incredible robot. Thanks LEGO, this is FUN!

WHAT'S NEW

CONNECT-3

Connect 3 is a two players game which takes place on a 6x5 rectangular board placed between you and the robot. One player has 15 white men and the other 15 black men.

Each player can drop a man at the top of the board in one of the six columns; the man falls down and fills the lower unoccupied square. Of course a player cannot drop a man in a certain column if it's already full (i.e. it already contains six men). There's no rule about which color should play first, but you must play with black men (more contrast for it).

The game ends when ALL 30 men (15+15) are placed.

The object of the game is to connect 3 men vertically, horizontally or diagonally in line.
If the board is filled the player that have connected the high number of lines have won. The robot represent the score with a value that is the difference between the number of white lines (composed of 3 white man) minus the black lines (composed of 3 black man). So if the score on the RCX display is positive (relative to robot score) than you are in trouble!!!

Software

578 Lines of pure C code compiled with Quite C 1.05, ~7.5Kb of srec code. The software use a complex minmax search with alpha-beta pruning with a tree 5 level depth. A very good position evaluation algorithm help him a lot! Look at the source code

Hardware

A Cartesian based robot with light feedback positioning and a dispenser for piece. The robot have a phase to setup the exact quantity of light to distinguish black, gray and white lines or men. The robot use the board (a simple gif printed on a white sheet) to understand the robot position.

You must initially put the robot over a white sheet that you must put high respect the board (look this photo) when you download the program the robot move to collect some light value.

Photo

If you want to build my robot look here...

 

VERSION HISTORY

2.0

  • Alpha-beta pruning
  • More Speed
  • Support for some key command:
    • PGRM - quit/reset game (after that key press ONOFF to exit or other key to begin a new game)
    • ONOFF - Switch OFF the RCX (the game remain in memory. You can resume.)
    • VIEW - do a light setup (measure the correct light level for current condition)
    • RUN - pass
  • You can now switch Off the RCX playing a game RESUMING from the point of interrupt
  • Dynamic Position Evaluator (It's now hard to beat him)
  • Move Randomizer if found more bestmove
  • Now you can play as second (press RUN without placing a man)

1.0

  • Initial Release

FILES

  • tar20.zip - sources, bin compiled (srec), board.gif

[ QC | Introduction | What's new | CONNECT-3 | Software | Hardware | Photo | Version history | Files ]
Q&A: ferrara.levami-remove@libero.it