How do I write this in C programming? I need help with the code.   int isOpen(char move[THREE], char board[ROW][COL]) {     int open = FALSE;          int rowInt = getMoveRow(move);          int colInt = getMoveCol(move);          open = TRUE                    return open;

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter16: Searching, Sorting And Vector Type
Section: Chapter Questions
Problem 1TF
icon
Related questions
Question

How do I write this in C programming?

I need help with the code.

 

int isOpen(char move[THREE], char board[ROW][COL])
{
    int open = FALSE;
    
    int rowInt = getMoveRow(move);
    
    int colInt = getMoveCol(move);
    
    open = TRUE
    
    
    
    return open;
}

8. Write function isOpen to do the following
a. Return type integer
Parameter list
b.
i. 1-d character array (i.e. move), size 3
ii. 2-d character array (i.e. board), size 8 rows and 8 cols
c. Declare local variable open, data type integer, initialized to
FALSE
d. Declare local variable rowInt, data type integer, set equal to
function call getMoveRow, passing parameter move as an
argument
e. Declare local variable collnt, data type integer, set equal to
function call getMoveCol, passing parameter move as an
argument
f. Set local variable open equal to TRUE or FALSE based on logic
i. If the row Int 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
6
g. Return variable open
Transcribed Image Text:8. Write function isOpen to do the following a. Return type integer Parameter list b. i. 1-d character array (i.e. move), size 3 ii. 2-d character array (i.e. board), size 8 rows and 8 cols c. Declare local variable open, data type integer, initialized to FALSE d. Declare local variable rowInt, data type integer, set equal to function call getMoveRow, passing parameter move as an argument e. Declare local variable collnt, data type integer, set equal to function call getMoveCol, passing parameter move as an argument f. Set local variable open equal to TRUE or FALSE based on logic i. If the row Int 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 6 g. Return variable open
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Problems on Dynamic Programming
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr