Write a code that plays the game of connect four in java. It needs to contain two
Question:
Write a code that plays the game of connect four in java. It needs to contain two classes( one class holds the connect four board). It also must contain a play again feature and comments on the code
Explanation of the game: Connect Four is a two-player game in which the players take turns dropping their colored discs from the top into a seven-column, six-row vertically-suspended grid. The pieces fall straight down, occupying the next available space within the column. The object of the game is to connect four of one’s own discs of the same color next to each other vertically, horizontally, or diagonally before one’s opponent can do so. The first player should be red and the second yellow. Have the program alternate between the two players having the users select a column to drop their disc. The program should test for a win at each move and if a particular player wins, it should stop the game and announce the winner. The program should then ask the user if they would like to play another game and if so, start a new game. When they decide to end, the program should neatly print out a final score of the total number of games, as well as each player’s number of wins. The game-board display should be a simple display of R’s and Y’s, such as,
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba