follow right wall (unlike the other sheeple :))

master
Thomas Lindner 2022-05-20 19:00:35 +02:00
parent 173182f8e7
commit 374402299d
1 changed files with 3 additions and 3 deletions

View File

@ -172,11 +172,11 @@ asio::awaitable<bool> Bot::Move(Direction direction) {
}
asio::awaitable<void> Bot::ChooseMove() {
// follow left wall
// follow right wall
while (!co_await Move(heading)) {
heading = Direction{(static_cast<int>(heading) + 1) % 4};
heading = Direction{(static_cast<int>(heading) + 3) % 4};
}
heading = Direction{(static_cast<int>(heading) + 3) % 4};
heading = Direction{(static_cast<int>(heading) + 1) % 4};
co_return;
}