... | ... |
@@ -2,6 +2,7 @@ |
2 | 2 |
#include <cstdlib> |
3 | 3 |
#include <ctime> |
4 | 4 |
#include <iostream> |
5 |
+#include <sstream> |
|
5 | 6 |
#include <thread> |
6 | 7 |
#include <vector> |
7 | 8 |
|
... | ... |
@@ -36,9 +37,11 @@ struct Maze |
36 | 37 |
} |
37 | 38 |
void print() const |
38 | 39 |
{ |
39 |
- for (auto y = 0; y < h; ++y, std::cout << '\n') |
|
40 |
+ std::ostringstream oss; |
|
41 |
+ for (auto y = 0; y < h; ++y, oss << '\n') |
|
40 | 42 |
for (auto x = 0; x < w; ++x) |
41 |
- std::cout << (cells[w * y + x] == PATH ? " " : "██"); |
|
43 |
+ oss << (cells[w * y + x] == PATH ? " " : "██"); |
|
44 |
+ std::cout << oss.str(); |
|
42 | 45 |
} |
43 | 46 |
int w; |
44 | 47 |
int h; |