Code: Select all
##########################################################
# Mini XiangQi, http://mlwi.magix.net/bg/minixiangqi.htm #
##########################################################
Variant: Mini Xiangqi
Board: 7x7
FEN: "rchkhcr/p1ppp1p/7/7/7/P1PPP1P/RCHKHCR w 0 1"
XBoard pieces: "PH.R.....K.C.ph.r.....k.c."
XBoard parent: "xiangqi"
Zone: palace = c1,d1,e1,c2,d2,e2,c3,d3,e3,c5,d5,e5,c6,d6,e6,c7,d7,e7
Piece: Knight
Move: leap (1,0)+(1,1)&(2,1)
Symbol: "H", "H,h"
Value: 400
Piece: Cannon
Move: slide (H,V)
Capture: hop (H,V)
Symbol: "C", "C,c"
Value: 450
Piece: Rook
Move: slide (H,V)
Symbol: "R", "R,r"
Value: 950
Piece: King
Move: leap (0,1)
Prison: palace, palace
Symbol: "K", "K,k"
Flags: royal
Piece: Pawn
Move: aleap (1,0)|(0,1)|(-1,0)
Symbol: "P", "P,p"
Value: 200
Rule: taboo, chase rule
Rule: checkmate = win
Rule: stalemate = win
Rule: repeat3 = draw
Code: Select all
--- ../xboard-6ffd7b3/board.c 2015-02-21 20:08:00.000000000 +0100
+++ board.c 2015-03-20 17:21:57.000000000 +0100
@@ -252,12 +252,14 @@
int square_color;
if (gameInfo.variant == VariantXiangqi) {
- if (column >= 3 && column <= 5 && row >= 0 && row <= 2) {
- square_color = 1;
- } else if (column >= 3 && column <= 5 && row >= 7 && row <= 9) {
- square_color = 0;
- } else if (row <= 4) {
+ int col1 = gameInfo.boardWidth / 3;
+ int col2 = col1 + 2;
+ if (column >= col1 && column <= col2 && row >= 0 && row <= 2) {
+ square_color = 1 - (gameInfo.boardHeight & 1);
+ } else if (column >= col1 && column <= col2 && row >= gameInfo.boardHeight-3 && row < gameInfo.boardHeight) {
square_color = 0;
+ } else if (row < gameInfo.boardHeight/2) {
+ square_color = gameInfo.boardHeight & 1;
} else {
square_color = 1;
}
