swipe(), copy_grid(), and gridNotEqual() functions.
generate().
bool success = false;
while (!success) {
int i = rand() % 4;
int j = rand() % 4;
if (grid[i][j] == 0) {
grid[i][j] = getRandomNumber();
success = true;
}
// ...
swipe().
inverse() and transpose() functions to implement the other directions. While the code is clean, the efficiency is not, because of all the array copying in the inverse() and transpose() functions.swipe() directions as the lab question instead.