Fixed black and white square naming in demo

This commit is contained in:
Dmitriy Shishkov 2021-12-19 13:15:36 +03:00
parent 78960fcbee
commit e011a5d7ed
2 changed files with 8 additions and 8 deletions

View File

@ -73,15 +73,15 @@ int main() {
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
const string long_sep = string((res.size() + 8) * SQUARE_WIDTH, 219), const string long_sep = string((res.size() + 8) * SQUARE_WIDTH, 219),
short_sep = string(4 * SQUARE_WIDTH, 219), short_sep = string(4 * SQUARE_WIDTH, 219),
black = string(SQUARE_WIDTH, 219), black = string(SQUARE_WIDTH, ' '),
white = string(SQUARE_WIDTH, ' '); white = string(SQUARE_WIDTH, 219);
SetConsoleCP(855); SetConsoleCP(855);
#else #else
const string long_sep = str_of((res.size() + 8) * SQUARE_WIDTH, ""), const string long_sep = str_of((res.size() + 8) * SQUARE_WIDTH, ""),
short_sep = str_of(4 * SQUARE_WIDTH, ""), short_sep = str_of(4 * SQUARE_WIDTH, ""),
black = str_of(SQUARE_WIDTH, ""), black = string(SQUARE_WIDTH, ' '),
white = string(SQUARE_WIDTH, ' '); white = str_of(SQUARE_WIDTH, "");
#endif #endif
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
@ -92,10 +92,10 @@ int main() {
for (auto cell : res[i]) for (auto cell : res[i])
switch (cell) { switch (cell) {
case Trit::T: case Trit::T:
cout << white; cout << black;
break; break;
case Trit::F: case Trit::F:
cout << black; cout << white;
break; break;
default: default:
throw std::runtime_error("Empty cell is not allowed. Your QR code is corrupted."); throw std::runtime_error("Empty cell is not allowed. Your QR code is corrupted.");

View File

@ -78,8 +78,8 @@ You can get resulting QR code as 2D array of `Trits`:
```c++ ```c++
enum Trit { enum Trit {
EMPTY = -1, EMPTY = -1,
F, // Black square F, // White square
T, // White square T, // Black square
}; };
``` ```