-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
74 lines (66 loc) · 2.08 KB
/
main.cpp
File metadata and controls
74 lines (66 loc) · 2.08 KB
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
#include <iostream>
#include "State.h"
#include <vector>
#include <queue>
#include <iostream>
int main()
{
int option = 0;
int dim = 0;
int curr = 0;
std::vector<int>board;
std::cout << "Welcome to our puzzle! Please enter 1 for a hard-coded puzzle, or 2 to enter your own values." << std::endl;
std::cin >> option;
if (option == 1){
State curr(3);
// std::cout << curr.check() << std::endl;
// curr.printState();
curr.move(3, curr);
// curr.move(3, curr);
curr.move(0, curr);
curr.move(1, curr);
curr.move(2, curr);
std::cout << "Please enter which way you would like to solve the puzzle (1: euclidean, 2: misplaced, 3: uniform):" << std::endl;
std::cin >> option;
if (option == 1){
curr.solveEuclidean();
}
else if (option == 2){
curr.solveMisplaced();
} else {
curr.solveUniform();
}
}
if (option == 2){
std::cout << "Please enter the dimensions of your puzzle (min: 2)." << std::endl;
std::cin >> dim;
board.reserve(dim*dim);
for (int i = 0; i < dim * dim; ++i)
{
std::cout << "Please enter a number (-1 for an empty tile): " << std::endl;
std::cin >> curr;
board.push_back(curr);
}
State bingbong(dim);
bingbong.createBoard(board);
std::cout << "Please enter which way you would like to solve the puzzle (1: euclidean, 2: misplaced, 3: uniform):" << std::endl;
std::cin >> option;
if (option == 1){
bingbong.solveEuclidean();
}
else if (option == 2){
bingbong.solveMisplaced();
} else {
bingbong.solveUniform();
}
}
// mystery testing option
if (option == 3){
std::vector<int>vec = {8, 7, 1, 6, -1, 2, 5, 4, 3};
State pur(3,vec);
pur.solveUniform();
// pur.solveEuclidean();
// pur.solveMisplaced();
}
return 0;
}