-
Notifications
You must be signed in to change notification settings - Fork 0
/
utilities.h
65 lines (53 loc) · 1.64 KB
/
utilities.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef utilities_h
#define utilities_h
#include <string>
#include "timer.h"
///////////////////////////////////////////////////////////////////////////
// Constants
///////////////////////////////////////////////////////////////////////////
const int CW = 0;
const int CCW = 1;
const int UP = 1;
const int LEFT = 4;
const int FRONT = 5;
const int RIGHT = 6;
const int BACK = 7;
const int DOWN = 9;
const int FACES = 12;
const std::string F2L = "/Users/Jorge/Desktop/CubeSolver2.5/F2L Algs.txt";
const std::string OLL = "/Users/Jorge/Desktop/CubeSolver2.5/OLL Algs.txt";
const std::string PLL = "/Users/Jorge/Desktop/CubeSolver2.5/PLL Algs.txt";
///////////////////////////////////////////////////////////////////////////
// Utility functions
///////////////////////////////////////////////////////////////////////////
struct Pair;
int randInt(int min, int max);
std::string intToTurn(int num);
bool restrct(int input, Pair* done, int pairsDone);
bool counterCheck(int* counters, int sizeArray, int num);
void resetCounters(int* counters, int sizeArray);
char opp(char input);
void clearScreen();
std::string OLLindex(int num);
std::string PLLindex(int num);
struct Move
{
std::string turn;
bool counts;
Move();
};
struct Pair
{
char c[3]; //the three different colors that characterize the pair (the first only applies to the corner)
int pos; //4 pair positions for 3x3, when cross on bottom: 0 - LF, 1 - RF, 2 - LB, 3 - RB
Pair();
};
struct Stamp
{
int attempts;
int moveCountAfter;
Timer t;
std::string info;
Stamp();
};
#endif /* utilities_h */