make output stream a Main parameter

This commit is contained in:
Eric Mertens
2023-01-31 09:15:15 -08:00
parent c6264a2a1b
commit 2f7949b8da
62 changed files with 191 additions and 190 deletions

View File

@@ -476,11 +476,11 @@ TEST_SUITE("2018-15 examples") {
}
}
auto Main(std::istream & in) -> void
auto Main(std::istream & in, std::ostream & out) -> void
{
auto const grid {Grid::Parse(in)};
Game game {std::move(grid)};
//game.debug_out_ = &std::cout;
std::cout << "Part 1: " << *Game{game}.Simulate() << std::endl;
std::cout << "Part 2: " << Part2(std::move(game)).first << std::endl;
//game.debug_out_ = &out;
out << "Part 1: " << *Game{game}.Simulate() << std::endl;
out << "Part 2: " << Part2(std::move(game)).first << std::endl;
}