Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void makeMove(int r, int c, int n[puzzleSize][puzzleSize])
- {
- if (r!=0 && n[r-1][c] == 0)
- {
- int temp = n[r-1][c];
- n[r-1][c] = n[r][c];
- n[r][c] = temp;
- }
- if (r!=4 && n[r+1][c]== 0)
- {
- int temp = n[r+1][c];
- n[r+1][c] = n[r][c];
- n[r][c] = temp;
- }
- if (c!=4 && n[r][c+1] == 0)
- {
- int temp = n[r][c+1];
- n[r][c+1] = n[r][c];
- n[r][c] = temp;
- }
- if (c!=0 && n[r][c-1] == 0)
- {
- int temp = n[r][c-1];
- n[r][c-1]= n[r][c];
- n[r][c] = temp;
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement