FontysICT-sem1

Challenge Four-in-a-row

Learning Goal Class, method, constructor, object, private, enum.
Extra Algorithm,
Required Knowledge Object, Method, If.
Challenge Type Programming.

Four in a row

Analysis, Design, Realization

Ideal if you can do the Analysis (What should the product do?) and the Design (How will the product do it?) on a whiteboard where you stand with a group of people. Talk about what classes you think you’ll need if you’re going to program Four on a Row. Try together to reach a good end result.

When you have thought of all the classes, then think of what exactly you would call those classes: write those names down. Remember that also the current state of the game must be stored in objects.

Note the following:

Create the game 4 in a row where you can play against the computer. Keep in mind the requirements below:

enum Field {Red,Yellow}
Field[] board:
board = new Field[6,7];
private Random Edge;

public SetAndSet()
{
   return new Put(Edge.Next(7));
}