Question: home / study / engineering / computer science / computer science questions and answers / c programming background: connect four is a two player game

home / study / engineering / computer science / computer science questions and answers / c programming background: connect four is a two player game in which players take turns dropping ...

Your question has been answered

Let us know if you got a helpful answer. Rate this answer

Question: C PROGRAMMING Background: Connect four is a two player game in which players take turns dropping ...

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 TASK: modifies the board by adding a game piece for the players in one of the columns.

int make_move(int board[ ] BOARD_ROW], int move, int player)

- board: current state of game board

- move: column where game piece is added; range of 0 to BOARD_ROW - 1

- player: the player making the move. 1 for player 1, 2 for player 2

RETURN VALUE: returns 1 if move was valid, returns 0 if invalid.

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!