Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Connect foure is a two-player connection board game, in which the players choose a color and then take turns dropping colored discs into a seven-column,
Connect foure is a two-player connection board game, in which the players choose a color and then take turns dropping colored discs into a seven-column, six-row vertically suspended grid. The pieces fall straight down, occupying the lowest available space within the column. The objective of the game is to be the first to form a horizontal, vertical, or diagonal line of four of one's own discs. Write a program ConnectFour.java that implements the connect four game using multi-dimensional arrays. In the preceding figure, the red disk is shown as "R" and the yellow disk as "Y". Whenever a disk is dropped, the program redisplays the board on the console and determines the status of the game (win, draw, or continue). If the user tries to enter more than 6 disks in one column, appropriate message should be displayed and the game should continue asking the user to enter into a new column. Here is a sample run of the program: java Connect Four 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Drop a red disk at column (0-6): 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Drop a yellow disk at column (0-6): 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 | Y! 1 1 Drop a yellow disk at column (0-6): 6 1 1 1 1 1 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started