Question: C PROGRAMMING Background: Connect four is a two player game in which players take turns dropping alternating colored disc (red and black) into a six

C PROGRAMMING

Background: Connect four is a two player game in which players take turns dropping alternating colored disc (red and black) into a six row by seven column vertically suspended grid. The object of the game is to connect four single colored discs in a row vertically, horizontally or diagonally.

state of the board : int board[BOARD_COL][BOARD_ROW]

constants BOARD_COL and BOARD_ROW are defined 7 and 6 respectively.

Goal: Write a helper function with the specifications.

Function 1: Checks if the proposed move is valid

int checkValid(int board[ ][BOARD_ROW], int move)

- board: current state of the board

- move: column of the board to drop a game piece; numbered 0 to BOARD_COL

Return value: returns 1 if move is valid and returns 0 if invalid. Invalid move if out of bounds or column is full.

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!