From 5a72da9ae99689a8a3571b23b7a639a4efc58abc Mon Sep 17 00:00:00 2001 From: tslil Date: Fri, 15 Jan 2021 23:45:16 -0500 Subject: Dragon is not separate, fixed concession, allowing playing as b/w --- include/ct1986.c | 4 ++-- include/tak.c | 10 ++++------ include/tak.h | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/ct1986.c b/include/ct1986.c index 1c3fa79..c80e32a 100644 --- a/include/ct1986.c +++ b/include/ct1986.c @@ -133,11 +133,11 @@ static enum WIN_TYPE w; if (w < 0xFF) { \ /* Somebody won, assign weights accordingly */ \ if (min == 0) { \ - if (w == WIN_ROAD_BLACK || w == WIN_FLAT_BLACK || w == WIN_DRAGON) \ + if (w == WIN_ROAD_BLACK || w == WIN_FLAT_BLACK) \ val = infty; \ else val = -infty; \ } else { \ - if (w == WIN_ROAD_WHITE || w == WIN_FLAT_WHITE || w == WIN_DRAGON) \ + if (w == WIN_ROAD_WHITE || w == WIN_FLAT_WHITE) \ val = -infty; \ else val = infty; \ } \ diff --git a/include/tak.c b/include/tak.c index 2ddb78b..d8d0a8e 100644 --- a/include/tak.c +++ b/include/tak.c @@ -330,14 +330,12 @@ check_win(void) { rb = check_road_colour(C_BLACK); rw = check_road_colour(C_WHITE); - if (rb == WIN_ROAD_BLACK) { - if (rw == WIN_ROAD_WHITE) { - return WIN_DRAGON; - } else { - return WIN_ROAD_BLACK; - } + if (rb == WIN_ROAD_BLACK && rw == WIN_ROAD_WHITE) { + return (ply & 1) ? rb : rw; // Dragons } else if (rw == WIN_ROAD_WHITE) { return rw; + } else if (rb == WIN_ROAD_BLACK) { + return rb; } // Do we do a flat count? diff --git a/include/tak.h b/include/tak.h index 27984a1..ad0b994 100644 --- a/include/tak.h +++ b/include/tak.h @@ -14,7 +14,7 @@ enum STONE_VARIANT { STONE_FLAT, STONE_STANDING, STONE_CAPSTONE }; enum MOVE_DIRECTION { M_UP, M_DOWN, M_LEFT, M_RIGHT }; enum WIN_TYPE { WIN_DRAW, WIN_FLAT_WHITE, WIN_FLAT_BLACK, - WIN_ROAD_WHITE, WIN_ROAD_BLACK, WIN_DRAGON}; + WIN_ROAD_WHITE, WIN_ROAD_BLACK }; typedef uint8_t data_t; typedef uint16_t colour_stack_t; -- cgit v1.2.3