From e41b10c7d7ddeb9560848b63859b58614d1362ef Mon Sep 17 00:00:00 2001 From: Jérôme Jutteau Date: Fri, 3 Jun 2011 14:21:41 +0200 Subject: digital/io-hub: raise king score --- digital/io-hub/src/robospierre/element.c | 14 +++++++------- digital/io-hub/src/robospierre/element.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/digital/io-hub/src/robospierre/element.c b/digital/io-hub/src/robospierre/element.c index 5b192e4f..37efa46f 100644 --- a/digital/io-hub/src/robospierre/element.c +++ b/digital/io-hub/src/robospierre/element.c @@ -280,15 +280,15 @@ element_score (position_t robot_pos, uint8_t element_id) && e.failure_until_s + failure_offset_s < chrono_remaining_time () / 1000) return -1; - if (e.type & ELEMENT_PAWN) - score += ELEMENT_PAWN_SCORE; - if (e.type & ELEMENT_QUEEN) - score += ELEMENT_QUEEN_SCORE; - if (e.type & ELEMENT_KING) + if (e.type == ELEMENT_KING) score += ELEMENT_KING_SCORE; - if (e.type & ELEMENT_ANY) + else if (e.type == ELEMENT_QUEEN) + score += ELEMENT_QUEEN_SCORE; + else if (e.type == ELEMENT_PAWN) + score += ELEMENT_PAWN; + else if (e.type == ELEMENT_ANY) score += ELEMENT_ANY_SCORE; - else if (e.type & ELEMENT_NONE) + if (e.type & ELEMENT_NONE) score /= 2; /* Add score modifier. */ diff --git a/digital/io-hub/src/robospierre/element.h b/digital/io-hub/src/robospierre/element.h index 9464c1f9..5b6ad9a4 100644 --- a/digital/io-hub/src/robospierre/element.h +++ b/digital/io-hub/src/robospierre/element.h @@ -57,8 +57,8 @@ #define ELEMENT_PAWN_SCORE 10 #define ELEMENT_ANY_SCORE 15 -#define ELEMENT_QUEEN_SCORE 20 -#define ELEMENT_KING_SCORE 30 +#define ELEMENT_QUEEN_SCORE 20 * 30 +#define ELEMENT_KING_SCORE 30 * 30 /** Emplacement attributes bits. */ #define ELEMENT_BONUS 1 -- cgit v1.2.3