
I need help writing function isOpen to do the following in C Programming
- Return type integer
- Parameter list
i. 1-d character array (i.e. move), size 3
ii. 2-d character array (i.e. board), size 8 rows and 8 cols
- Declare local variable open, data type integer, initialized to
FALSE
- Declare local variable rowInt, data type integer, set equal to
function call getMoveRow, passing parameter move as an argument
- Declare local variable colInt, data type integer, set equal to
function call getMoveCol, passing parameter move as an
argument
- Set local variable open equal to TRUE or FALSE based on logic
i. If the rowInt is not INVALID and
ii. If the colInt is not INVALID and
iii. If the element in array board at the row/col location is
equal to a SPACE, then the square is open
iv. Otherwise, it is not open
- Return variable open
This code needs to be updated using the above instructions(I have tried updating the code using the instructions, but there may be some errors in the code. Please fix and update the code):
int isOpen(char move[THREE], char board[ROW][COL])
{
int open = FALSE;
int rowInt = getMoveRow(move);
int colInt = getMoveCol(move);
if(rowInt != INVALID && colInt != INVALID && board[rowInt][colInt] == SPACE)
{
open = TRUE;
}
else
open = FALSE;
return open;
}
I would rate the work if my question is answered!

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





