diff options
| author | tslil <tslil@posteo.de> | 2021-01-15 23:45:16 -0500 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-08-28 19:37:41 +0100 |
| commit | 5a72da9ae99689a8a3571b23b7a639a4efc58abc (patch) | |
| tree | 24fb3f4858184f49f337e57662db5c6f42f8700e /include | |
| parent | f5df4d3710c94822a6602a3e4936287ea5d61bab (diff) | |
Dragon is not separate, fixed concession, allowing playing as b/w
Diffstat (limited to 'include')
| -rw-r--r-- | include/ct1986.c | 4 | ||||
| -rw-r--r-- | include/tak.c | 10 | ||||
| -rw-r--r-- | include/tak.h | 2 |
3 files changed, 7 insertions, 9 deletions
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; |
