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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started