An Interactive M,N,K (4,5,4) Game for a person to play against a computer. The game board consists of a 4 X 5 grid (as shown below). The computer and the human players take turns to mark the cells. The first player who gets 4 consecutive marks in a row, in a column, or in a diagonal wins. The diagonal could be a 45 degree diagonal or a 135 degree diagonal.
The programming has these features:
- The computer uses the X and the human uses the O mark. The human player can choose to go first or second.
- The program declares who the winner is by displaying a message on the screen.
- The program stops when all the cells are marked and there is no winner. In this case, the program displays a message declaring a draw.
The program uses Alpha-Beta-Search Algorithm for AI to search the best move. Cut-off and evaluation functions were applied to reduce the execution time.