Implementing an interactive connect-four game


Project Description:

Design and implement an Interactive Connect-Four game for a person to play against a computer. The game is a variation of the regular Connect-Four game with the popout rule.

The rules of the game are as follows:

• There is a 5 x 4 grid as shown below. The grid is initially empty with no balls.
• There are two players: human and computer. The computer has red balls and the human player has black balls. The human player can choose to go first or second.
• Each player takes turn to drop a ball from the top or remove (pop out) a ball of her/his own color from the bottom in one of the four columns.
• The first player to get four balls consecutively in the horizontal, vertical, or diagonal direction (45 or 135 degree) wins and the game stops when there is a winner.
• If the entire board is filled up and there is no winner, the game stops and a draw is declared.

1836_Connect four game.jpg
Use the Alpha-Beta Search Algorithm in your implementation. Every time your program calls the ALPHA-BETA SEARCH function to return an action, your program should display the following statistics for the game tree that has been generated: (1) maximum depth of tree (level of root node= 0), (2) total number of nodes generated (including root node), and (3) number of times pruning occurred within the MAX-VALUE function and (4) number of times pruning occurred within the MIN-VALUE function. As a minimum requirement, your program will run in command line mode that allows the player to specify which column to drop or remove a ball. C++, C#, Python, or Java are the preferred programming languages. If you would like to use other languages, send me an e-mail first.

You can implement one of the followings:

1) Design and implement a graphical user interface (GUI) that displays the 5 x 4 grid on the screen, and use the mouse to pick the column to drop or remove a ball.
2) In the design above, the computer plays the best strategy. Design your program in such a way that the computer does not always play the best strategy so players with different skill levels can play with the computer. The human player can input the level of difficulty (say from 1 to 3) before the start of the game.
3) Write Source code for your program. Complete documentation and in-line comments are required for your source code.
4) A high-level description of your design and program. There is no need to describe how the Alpha-Beta search algorithm works but you should describe how you define the utility values for terminal states and how your Terminal-Test function works. You should describe how it works.

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Implementing an interactive connect-four game
Reference No:- TGS0506

Expected delivery within 24 Hours