Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. 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) { //the move must not change any of the original squares if (original_board[row][col] != UNKNOWN){ cout << "Sorry, original squares cannot be changed."; return false; } //the move must follow the main rules of the game else if (!board_has_no_threes(current_board, size)){ cout << "Sorry, that move violates a rule."; return false; } else if (!board_has_no_duplicates(current_board, size)){ cout << "Sorry, that move violates a rule."; return false; } return true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement