Question: This problem uses MATLAB programming code. Really stuck on this one. 2. (70 pts) CONNECT-4. Connect-4 is a two-player game in which the players take

This problem uses MATLAB programming code. Really stuck on this one.  This problem uses MATLAB programming code. Really stuck on this one.

2. (70 pts) CONNECT-4. Connect-4 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. For this lab you are to create a preliminary program so you can play with the computer. However no artificial intelligence is required, nor winner is called Specifications: 1) The computer will always start the game. 2) There is no need to test for a win. If there is a winning situation, we will ignore it and keep playing until the grid is filled. 3) No artificial intelligence is required; meaning the computer randomly picks a column to drop disc. the 4) Instead of colored discs, we will use numbers. Let the computer be "1's and you be 2's 5) Initially the grid will be filled with all zeros 6) Players will only pick a column (not a row) and let the disc fall down to the lowest available location at that column. Error check for user's input 7) If a column is all filled up, let the player choose another one, until a non-filled column is picked 8) The grid should be displayed in the beginning of the game and after every time a disc is dropped A sample screen is shown below. For this problem, the simple output using dispO is permitted. Computer drops its dics: Your turn. Enter the column # (1-7): 4 Computer drops its dics Your turn. Enter the column # (1-7)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!