Add includes of cassert

This commit is contained in:
2023-11-30 20:29:35 +00:00
parent f421aee783
commit be27621663
41 changed files with 140 additions and 77 deletions

View File

@@ -2,6 +2,7 @@
// Created by Matthew Gretton-Dann on 16/12/2022.
//
#include <cassert>
#include <array>
#include <iostream>
#include <map>
@@ -150,7 +151,7 @@ auto main() -> int
grid.push_back(line);
max_row_length = std::max(max_row_length, line.size());
}
for (auto& row : grid) { row.resize(max_row_length, ' ');};
for (auto& row : grid) { row.resize(max_row_length, ' '); };
std::string instructions;
if (!std::getline(std::cin, instructions)) {
@@ -183,7 +184,7 @@ auto main() -> int
Int const facing{encode_direction(direction)};
std::cout << " Position: " << pos.first << ", " << pos.second << " Facing: " << direction.first
<< ", " << direction.second << " = " << facing << "\n";
<< ", " << direction.second << " = " << facing << "\n";
}
Int const facing{encode_direction(direction)};
@@ -193,7 +194,7 @@ auto main() -> int
std::cout << row << "\n";
}
std::cout << "Position: " << pos.first << ", " << pos.second << " Facing: " << direction.first
<< ", " << direction.second << " = " << facing << "\n";
<< ", " << direction.second << " = " << facing << "\n";
std::cout << "Encoding: " << pos.second * 1000 + pos.first * 4 + facing;
return EXIT_SUCCESS;