From 374402299d1b31f3855e1fcba47198e62b6126f2 Mon Sep 17 00:00:00 2001 From: Thomas Lindner Date: Fri, 20 May 2022 19:00:35 +0200 Subject: [PATCH] follow right wall (unlike the other sheeple :)) --- src/main.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; }