-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
64 lines (55 loc) · 2.23 KB
/
Copy pathmain.cpp
File metadata and controls
64 lines (55 loc) · 2.23 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
#include "globals.h"
#include "input_handler.h"
#include "puzzle.h"
#include <iostream>
// #include <string>
// #include <string_view>
// #include <cstddef>
int main()
{
// Puzzle puzzle(); // this is to test delegating of constructor
// Puzzle puzzle(InitType{trivial});
// Puzzle puzzle(InitType{reverseTrivial});
// Puzzle puzzle(InitType{horizSwap});
// Puzzle puzzle(InitType{vertSwap});
// Puzzle puzzle(InitType{randomOrderDumber});
// Puzzle puzzle(InitType{randomOrderDumb});
InputHandler inputHandler(Input::puzzleMappings);
Puzzle puzzle(Puzzle::randomOrder);
#ifndef NDEBUG
std::cout << "Program was compiled in debug mode\n";
#endif
while(!puzzle)
// for (int i=0; i<2; ++i)
{
#ifndef NDEBUG
std::cout << "Empty cell in 1D is " << puzzle.empty_cell_1d() << "\n";
std::cout << "Empty cell in 2D is " << puzzle.empty_cell_2d().i
<< ", " << puzzle.empty_cell_2d().j << "\n";
std::cout << "Empty cell holds " << puzzle(puzzle.empty_cell_2d().i,
puzzle.empty_cell_2d().j) << "\n";
#endif
std::cout << puzzle;
std::cin >> inputHandler >> puzzle;
// std::string outstring {};
// std::cin >> inputHandler;
// std::cout << "Translated string: " << inputHandler << '\n';
puzzle.update_status();
}
return 0;
// a few ideas for how this should look like in the future
// while(!puzzle)
// {
// cout << puzzle;
// cin >> inputHandler >> puzzle;
// // puzzle.update_status(); // move this into push function
// /* inputHandler should contain a dictionary turning 'wasd' characters
// * into characters for the switch inside puzzle. The dictionary will
// * be hard-coded. The whole thing will be string-based/stream-based
// * and will allow for simple undoing and redoing. The inputHandler
// * will take care of recording a history in order to feed the correct
// * characters to puzzle. 'u' and 'r' will be used for undo and redo
// * respectively.
// */
// }
}