CONNECT FOUR
TOPIC 03v2 – CONNECT FOUR AI

 

LESSON DEMO

 

 

TEACHER’S DEMO

 

1)    Get the software files and bring them into Eclipse.

2)    Talk about Connect Four.  Go to an online game of Connect 4 and play a quick game.

3)    Go over the list of provided files.  Many are AIAgents.  The program files are Tester, Game, Series, Tournament and Slot.

4)    Show how to run a single game.  Open the Tester class and try the three different options to run a single game (Human vs Human, AI vs AI, Human vs AI).  Make a note that and AIAgent that is null will be a human player.

5)    Show how to change the AIAgents involved in a game.  Introduce the AIAgents that are provided with the software. 

6)    Spend a bit of time testing the different AIAgents.  Perhaps allow time for a Human vs Human match between 2 players.

7)    Show how to run a series of games.  Again, in the Tester class, uncomment the code that runs a series.  Show how to change the AIAgents involved in the series.

8)    Create our own AIAgent together!  We will create the SixSevenAI that picks column 6 or 7 all the time.  We will pit it against RandomAI01 to see which is better.

9)    Copy the SixSevenAI class into SixSevenAI02 class.  This time, there should also be a small chance that a different column is chosen randomly.  It this AI better or worse against RandomAI?  How does it fare against the first SixSevenAI?

10) Show how to run a tournament.  This is done again in the Tester class.

11) Show how to get information from the Game object.  Check out CampeauAI01 and CampeauAI02 to get ideas.

12) You are ready to start.  You can copy the code from one of the existing AIAgents into your own class and start altering it.