diff --git a/src/main.cc b/src/main.cc index 68afe81..c361864 100644 --- a/src/main.cc +++ b/src/main.cc @@ -172,11 +172,11 @@ asio::awaitable Bot::Move(Direction direction) { } asio::awaitable Bot::ChooseMove() { - // follow left wall + // follow right wall while (!co_await Move(heading)) { - heading = Direction{(static_cast(heading) + 1) % 4}; + heading = Direction{(static_cast(heading) + 3) % 4}; } - heading = Direction{(static_cast(heading) + 3) % 4}; + heading = Direction{(static_cast(heading) + 1) % 4}; co_return; }