Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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. image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions