about summary refs log tree commit diff stats
path: root/Source/Randomizer2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Randomizer2.cpp')
-rw-r--r--Source/Randomizer2.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/Source/Randomizer2.cpp b/Source/Randomizer2.cpp index 00b584e..e4f2b9f 100644 --- a/Source/Randomizer2.cpp +++ b/Source/Randomizer2.cpp
@@ -14,6 +14,7 @@ Randomizer2::Randomizer2(const std::shared_ptr<Memory>& memory) : _memory(memory
14 14
15void Randomizer2::Randomize() { 15void Randomizer2::Randomize() {
16 RandomizeTutorial(); 16 RandomizeTutorial();
17 RandomizeSymmetry();
17 // RandomizeKeep(); 18 // RandomizeKeep();
18} 19}
19 20
@@ -105,44 +106,44 @@ void Randomizer2::RandomizeTutorial() {
105 x = 1; 106 x = 1;
106 y = 1; 107 y = 1;
107 toTheRight = true; 108 toTheRight = true;
108 cuts.emplace_back(Pos{0, 1}); 109 cuts.emplace_back(0, 1);
109 break; 110 break;
110 case 2: 111 case 2:
111 x = 1; 112 x = 1;
112 y = 1; 113 y = 1;
113 toTheRight = true; 114 toTheRight = true;
114 cuts.emplace_back(Pos{1, 0}); 115 cuts.emplace_back(1, 0);
115 break; 116 break;
116 case 3: 117 case 3:
117 x = 11; 118 x = 11;
118 y = 1; 119 y = 1;
119 toTheRight = false; 120 toTheRight = false;
120 cuts.emplace_back(Pos{12, 1}); 121 cuts.emplace_back(12, 1);
121 break; 122 break;
122 case 4: 123 case 4:
123 x = 11; 124 x = 11;
124 y = 1; 125 y = 1;
125 toTheRight = false; 126 toTheRight = false;
126 cuts.emplace_back(Pos{11, 0}); 127 cuts.emplace_back(11, 0);
127 break; 128 break;
128 } 129 }
129 while (y < p.height) { // The final cut will push y below the bottom of the puzzle, which means we're done. 130 while (y < p.height) { // The final cut will push y below the bottom of the puzzle, which means we're done.
130 switch (Random::RandInt(1, 4)) { 131 switch (Random::RandInt(1, 4)) {
131 case 1: // Go right 132 case 1: // Go right
132 if (x < p.width-2) { 133 if (x < p.width-2) {
133 cuts.emplace_back(Pos{x+1, y}); 134 cuts.emplace_back(x+1, y);
134 x += 2; 135 x += 2;
135 } 136 }
136 break; 137 break;
137 case 2: // Go left 138 case 2: // Go left
138 if (x > 1) { 139 if (x > 1) {
139 cuts.emplace_back(Pos{x-1, y}); 140 cuts.emplace_back(x-1, y);
140 x -= 2; 141 x -= 2;
141 } 142 }
142 break; 143 break;
143 case 3: 144 case 3:
144 case 4: // Go down (biased) 145 case 4: // Go down (biased)
145 cuts.emplace_back(Pos{x, y+1}); 146 cuts.emplace_back(x, y+1);
146 y += 2; 147 y += 2;
147 break; 148 break;
148 } 149 }
@@ -159,6 +160,12 @@ void Randomizer2::RandomizeTutorial() {
159 } 160 }
160} 161}
161 162
163void Randomizer2::RandomizeSymmetry() {
164 { //
165
166 }
167}
168
162void Randomizer2::RandomizeKeep() { 169void Randomizer2::RandomizeKeep() {
163 { // Hedges 1 170 { // Hedges 1
164 Puzzle p; 171 Puzzle p;