This question is about working with 2 dimensional arrays in


Problem:

This question is about working with 2 dimensional arrays. In this program, you will implement an ascii version of the classic game "Connect 4".

Connect 4 is is a 2 player game played on a 7 rows by 6 columns vertical grid of squares. Each player takes turns inserting colored disks (checkers) into the top row of the grid. When inserted, a disk falls until it hits the bottom of the grid or another disk that was inserted previously. The object of the game is for a player to place 4 disks in a row, either horizontally, vertically or diagonally. The game ends when either player achieves victory, or if there are no more open squares, in which case the game is a draw.

Instructions

1. Write a console (command line) application that will allow two players to play connect 4.

2. Your program should present the players with an ascii playing board, and allow the players to press number keys to determine which column they want to insert a disk into. When a player makes a move, print a bunch of newlines, and then print the updated board.

3. Be sure to handle illegal inputs properly, including letter presses, or pressing numbers that are out of range, and not allowing input in columns that are full.

4. Print your name as part of the board layout.

5. When a game is over, allow the players to decide whether they want to quit or start a new game, rather than just ending.

6. Optional features: Keep a running total of how many games each player has won since the start of the program. Ask the users to enter their names when the program starts. Include the names of the users in your prompts and board layout.

Additional Information:

This problem is from Computer Science, particularly to Java programming. The question here is about writing the program with ascii version of the classic game Connect 4. Connect 4 is a game which can employed for best demonstrating 2 dimensional arrays. The solution has all the coding.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: This question is about working with 2 dimensional arrays in
Reference No:- TGS01110072

Now Priced at $40 (50% Discount)

Recommended (90%)

Rated (4.3/5)