Need help with my C++ intro class free write review. Having a hard time with the
ID: 3758193 • Letter: N
Question
Need help with my C++ intro class free write review. Having a hard time with the a 3-part gameplay question. Please Help.
Functions to write:
Question 3)
part A)
/**
* Requires: size <= MAX_SIZE and size is a positive even integer.
* Modifies: Nothing.
* Effects : Returns true if and only if the board has been solved,
* i.e. all squares are RED or BLUE and the board does not
* violate any of the rules of 0hh1.
* Used In : play_board()
*/
bool board_is_solved(const int board[MAX_SIZE][MAX_SIZE], int size);
Part B)
/**
* Requires: Nothing.
* Modifies: cout, row, col
* Effects : Checks if the input was valid: row_input is between 1 and
* size inclusive, col_input is between A and (A + size - 1)
* inclusive, and color_char is one of (X, O, x, o, -).
* If input is invalid, prints an error message and returns
* false.
* Otherwise translates row_input and col_input to 0-indexed
* row and column numbers, assigns them to row and col, and
* returns true.
* Used In : make_move()
* Note : The following message is printed as appropriate:
* "Sorry, that's not a valid input." You might have to consider using toupper() library function at some point
*/
bool check_valid_input(int size, int row_input, char col_input,
char color_char, int &row, int &col);
Part C)
/**
* Requires: size <= MAX_SIZE and size is a positive even integer,
* 0 <= row && row < size && 0 <= col && col < size.
* Modifies: cout
* Effects : Returns true if and only if the specified square was not
* set in the original board, and placing the given color in
* the given square of the current board does not create an
* invalid board. Prints messages informing the user that
* original squares cannot be changed or that a move violates
* a rule, as appropriate.
* Used In : make_move()
* Note : The following messages are printed as appropriate:
* "Sorry, original squares cannot be changed."
* "Sorry, that move violates a rule."
*/
bool check_valid_move(const int original_board[MAX_SIZE][MAX_SIZE],
const int current_board[MAX_SIZE][MAX_SIZE],
int size, int row, int col, int color);
---------------------------------------------------------------------------------------
Really appreciate the help! Also any explaination will be very appreciated to help me understand this question. If you need more information, please do not hesitate to comment.
(note: please do not use system("Pause")
These links will be helpful to identify functions to call (assume these functions are already defined):
Utility.h
http://pastebin.com/3aYXfPCx
Driver.h
http://pastebin.com/zHXcvnwA
Main.cpp
http://pastebin.com/3jyPuibc