From 49baaba539169b5309c3176d9b5cdea2609664d8 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 17 Feb 2019 12:57:39 +0100 Subject: Work on mm ai's --- ai_mm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ai_mm.cpp') diff --git a/ai_mm.cpp b/ai_mm.cpp index 4d9a239..d74f7c7 100644 --- a/ai_mm.cpp +++ b/ai_mm.cpp @@ -26,7 +26,7 @@ static int evaluate(Board &bd, uint8_t myclr) { int idx = BSZ * y + x; \ uint8_t clr = bd[idx]; \ if (clr == 0) continue; \ - for (int i = 1; i <= RLEN; i++, x += (_dx), y += (_dy), idx += BSZ * (_dy) + (_dx)) { \ + for (int i = 1; i <= RLEN; i++, idx += BSZ * (_dy) + (_dx)) { \ if (bd[idx] != clr) break; \ score += i * (3 - 2 * clr); \ } \ @@ -37,7 +37,7 @@ static int evaluate(Board &bd, uint8_t myclr) { CHECK(bounds.left , bounds.right - (RLEN-1), bounds.top, bounds.bottom , 1, 0); CHECK(bounds.left , bounds.right - (RLEN-1), bounds.top, bounds.bottom - (RLEN-1), 1, 1); CHECK(bounds.left , bounds.right , bounds.top, bounds.bottom - (RLEN-1), 0, 1); - CHECK(bounds.left - (RLEN-1), bounds.right , bounds.top, bounds.bottom - (RLEN-1), -1, 1); + CHECK(bounds.left + (RLEN-1), bounds.right , bounds.top, bounds.bottom - (RLEN-1), -1, 1); #undef CHECK -- cgit v1.2.3-54-g00ecf