Merge branch 'main' of hub:glguy/aocpp

This commit is contained in:
Eric Mertens 2022-11-17 08:38:43 -08:00
commit 4d4dfb4424

View File

@ -63,7 +63,7 @@ auto QuineMcCluskey(
std::vector<std::set<std::string>> nextbatch; std::vector<std::set<std::string>> nextbatch;
nextbatch.resize(current.size()-1); nextbatch.resize(current.size()-1);
for (std::size_t ones = 0; ones+1 < nextbatch.size(); ones++) { for (std::size_t ones = 0; ones+1 < current.size(); ones++) {
if (!current[ones+1].empty()) { if (!current[ones+1].empty()) {
for (auto const& t1 : current[ones]) { for (auto const& t1 : current[ones]) {
for (auto const& t2 : current[ones+1]) { for (auto const& t2 : current[ones+1]) {
@ -245,7 +245,7 @@ auto Compute(
auto const terms = QuineMcCluskey(p, sensor.size(), cases); auto const terms = QuineMcCluskey(p, sensor.size(), cases);
std::cout << (p ? "\nTRUE\n" : "\nFALSE\n"); std::cout << (p ? "\nTRUE\n" : "\nFALSE\n");
for (auto const s : sensor) { for (auto const s : sensor) {
std::cout << char('A'+s); std::cout << char('A'+s-1);
} }
std::cout << std::endl; std::cout << std::endl;
for (auto const& term : terms) { for (auto const& term : terms) {