Team Hassenplug's

Stick - A Connect Four Robot

About the Robot

This is a robot that was designed and built to play Connect-Four.
After I built Full Contact, I had another idea for a very simple robot. I ended up building a one motor robot named "Gravity Based ". It used a large wheel, suspended by some string and attached to two places on the robot. One end was attached to the chip holder, and pushed the row of chips into the feeder. The other was attached to the feeder, to pull it back into place, after the chip was loaded.

It didn't scan the board, and would randomly drop chips into the game.

From that, I came up with the same scheme as a couple other people. The idea is to drop a measuring stick down inside the board, and see how far it falls.

 

The Software

Stick uses almost the same software as my other robot, Full Contact.  The only difference is that all the robot control and logic is included in one program.

The Hardware

The unique part about stick is the hardware.  Stick was designed to use only the electronics from a single Mindstorms RIS.  The whole robot only uses 2 motors, 2 touch sensors, and 1 light sensor.

The key piece of this robot is the stick. It's made of three colors, white, gray, and black.  A light sensor points at the stick, to read the color, and determine the current position.  The black section is used to locate the "home" position, which is used whenever the arm is moving.

The white and gray areas are used to determine if the number of chips in a column is odd or even.  The robot doesn't actually even count the number of chips, but just tracks if the number of chips in a given column is odd or even, and if that value has changed.

The stick can also be raised above the black "home" area to allow a chip to fall into the current column.

One motor drives the arm in and out, to move to different columns on the game board. The second motor raises & lowers the stick.

A touch sensor is used to count tabs, which allow the robot to move the arm in and out to the correct column.

And, the other touch sensor is used so human players can indicate when they are done with their turn.

Opponents

Both Stick and Full Contact have been programmed so a wire can be connected directly from the motor port on one to a sensor port on the other.   The motor port can be switched from float to brake and then back to float, which reads as a touch sensor press on the other RCX.  This allows the robots to play each other, or a human opponent, without any changes in the programming or other hardware.

Comments

So far, the biggest complement about this robot came from a friend who actually said he didn't like it!  He said, "Until now I could justify not building a Connect Four robot, because I don't have tons of motors or sensors or RCXs.  But you've shown it can be done with a single RIS, so now I'll have to come up with another reason..."  :)

Another of my favorite comments came from a staff member of TechTV's The Screen Savers.  He said, "We get quite a few neat games on the show, but they're all virtual. This is a REAL game, and it's very cool."

Other Features

Look-ahead of 4 moves

Opening book with 384 moves

Fast-Guess - If opponent has only one move to prevent win, check there first.  If opponent played there, continue as normal, otherwise, play in that column (and win)

Do not check columns known to be full.

-

-

Runs on 16 mhz processor with 32k RAM

Common Questions

Q: "How does it know what color the chips are?"
A: It remembers.  It keeps track of where each person plays, and stores that in an array for later use.

 

Q: "Why does it keep going in the middle?"
A: Strategy.  On a normal Connect-Four board (7x6), there are 69 places to win.  51 of them  (about 75%) include at least one chip in the middle column.  Playing in the middle column is good strategy.

 

Q: "Can anyone beat it?"
A: Yes.  It doesn't play a perfect game.  Not even close.  With only 32k of RAM, and a 16mhz processor, there's only so much you can do.  But it also doesn't miss anything, like people often do.

 

Q: "What if I put in two chips (or take a chip out)?"
A: You lose .  However, Stick doesn't check for cheating (yet).

 

Q: "Can the robot go first?"
A: Yes.  I have it set so whoever's playing against the robot goes first.  That gives them the best chance to win.  But, if you want the robot to go first, it can.

 

Q: "How long did it take to build?"
A: About 2 weeks .  This robot was designed as an opponent for Full Contact.

 

This page is not associated with The LEGO Group in any way.