forked from cs0x7f/min2phase
-
Notifications
You must be signed in to change notification settings - Fork 6
/
tools.h
74 lines (61 loc) · 1.73 KB
/
tools.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
66
67
68
69
70
71
72
73
74
/**
* min2phaseCXX Copyright (C) 2022 Borgo Federico
* This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
* This is free software, and you are welcome to redistribute it
* under certain conditions; type `show c' for details.
*
* This file contains a lot of useful function for the cube.
* There is the random cube generator, the converter from a moves string to a cube,
* the benchmarking, the tests, the verify that chek if a cube is solvable and a
* super flip generator.
*/
#ifndef MIN2PHASE_TOOLS_H
#define MIN2PHASE_TOOLS_H 1
#include <cstdint>
#include <string>
/**
* Useful functions for the cube.
*/
namespace min2phase { namespace tools {
/**
* This function is used to set a seed for randomize the cube.
*
* @param seed : the seed for the random number.
*/
void setRandomSeed(uint32_t seed);
/**
* This is used to get a random cube state.
*
* @return : the string that contains the random cube.
*/
std::string randomCube();
/**
* Generate a cube from a scramble.
*
* @param s : the scramble.
* @return : the scrambled cube.
*/
std::string fromScramble(const std::string &s);
/**
* Generate a cube with the super flip: the cube where every edge is
* twisted.
*
* @return : the cube scrambled with every edge twisted.
*/
std::string superFlip();
/**
* Print the result of the benchmark.
*/
void benchmark();
/**
* Check if the cube is in a correct input.
*
* @return : the value of the error.
*/
int8_t verify(const std::string& facelets);
/**
* Tests the algorithm.
*/
void testAlgorithm();
} }
#endif //MIN2PHASE_TOOLS_H