-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPuzzle.h
48 lines (39 loc) · 814 Bytes
/
Puzzle.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once
class Puzzle
{
private:
//Directional Constants
const int UP = 1;
const int DOWN = 2;
const int LEFT = 3;
const int RIGHT = 4;
//Puzzle Size Constants
int ROWS{ 0 };
int COLS{ 0 };
//Color Constants
const int GREEN = 10;
const int RED = 12;
const int WHITE = 15;
//Max puzzle size.
int puzzle[5][5] = { 0 };
// Set width of tiles
int tileWidth = 5;
// Number of moves to solve the puzzle
int Moves{ 0 };
public:
Puzzle();
void setDimensions(int _side);
void make();
void print() const;
void swap(int _ROW, int _COL, int _direction);
bool slide();
bool slide(int _direction);
void shuffle();
bool winCheck() const;
void updateScreen(int r, int c) const;
int checkTileLocation(int r, int c) const;
int attempts();
void write();
void read() const;
~Puzzle();
};