Connect 4 is a Milton-Bradley children`s game which - Rose

Connect 4 is a MiltonBradley children's
game which is a
variation on
TicTacToe. Players
alternately drop
checkers into slots
where they fall to the
bottom-most unfilled
position. The object is
to be the first to get
four checkers of your
color in a row,
vertically,
horizontally, or
diagonally.
<not sure if we should
call the pieces checkers or simply “pieces”. Also, we need to specify that the pieces can
be red or black>
Notice that there are seven columns, each of which can hold up to six checkers.
You are to write a program to simulate this game. Your program should include a Square
class. A Square knows can raw itself in the correct location with the checker it contains
(or a white circle indicating an empty square). If a square is the recipient of the most
recently dropped checker, it can find out if the game has been won by asking the squares
around it.
The Board object has an array of these squares. When the mouse is clicked on a column,
a checker of the appropriate color is placed in the lowest empty square in that column (if
the column is full, the click is ignored).
Here is an iterative enhancement plan. Do as many of these steps as you can before time
runs out.
i)
ii)
iii)
iv)
v)
Draw the grid of squares representing an empty board (containing 7 columns
and 6 rows of white circles indicating empty pieces?).
Write code that places red and black checkers in some of the squares.
Respond to a mouse click by placing a checker in the lowest square of the row
that???that was clicked
Alternate colors so that one click places a red checker, the next click a black
one, etc.
Make a click in a column place the checker in the lowest available square in
that column.
HERE IS WHAT A SAMPLE GAME MIGHT LOOK LIKE: (place a link here).
<I do not want speed to be a factor and it will be if we give this extra credit problem>
People who get this far are A students anyway>
EXTRA CREDIT PROBLEM: If you have done all of the above parts and had them
checked by us, you may work on checking for four in a row. Some partial credit will be
given if you can only check vertically or horizontally. Can you find a unified approach to
checking in all directions?