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
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