follow right wall (unlike the other sheeple :))
This commit is contained in:
parent
173182f8e7
commit
374402299d
|
@ -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) + 1) % 4};
|
||||
co_return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue