The game known in this project as Connect Three is a variant of Connect Four in which a player wins by matching 3 of their pieces
in a line (rather than 4) on board that is 5 rows by 4 columns (rather than 6 rows by 7 columns). Player X always goes first, resulting
in first player advantage for Player X due to the particular parameters of this variant of the game.
You are given two files that form a partially working implementation of the Connect Three game.
The abstract class ConnectThree provides the GUI, most of the logic except for win detection, and several artificial intelligences
(AI’s) for playing the game. You can’t make any changes to the ConnectThree class, and it can’t be executed.
The concrete class Sample provides partial win detection in an inefficient way and a mediocre AI. It also provides the main
You must implement complete win detection in an efficient fashion including all possible vertical, horizontal, and diagonal wins.
The sample win detection you are given is inefficient and only detects vertical wins. Until you implement complete win detection,
it will be nearly impossible to develop and test any reasonable AI.
After completing win detection, you can create one or more AI’s to play the game. There are three built-in AI’s included in the
abstract class and one included in the sample concrete class. These AI’s and any others you implement in your own concrete class
can be selected independently for each of Player X and Player O using the drop-down menus at the bottom of the GUI.
The Random AI plays randomly with no strategy.
The Naive AI will try to win in the current turn if it can, or else it will try to prevent its opponent from winning in the next turn if
it can, or else it will play randomly without any strategy for future turns.
The Human AI is a pseudo-AI which never makes a decision, forcing a human player to make its decisions.
The Lefty AI always plays in the leftmost available column. You can remove this AI in your own implementation. It is only provided
to show you how to implement an AI and register it in the drop-down menus.
Hi,
i provide free support for two weeks after project is completed, it includes any bug fixes, new additional requirements of small-medium size.
I am the certified java professional with 10+ years industry experience in java, j2ee , software architecture, android.