For Chinese chess, each word has its own rules, and the so-called unregulated is not a square.
Chessboard is set first, A: Array [1..10] [1..9] of mapstruct; is a two-dimensional array, each unit full-customized chessboard structure does not define a chess word structure
Int Stepjudge (int Oldx, int in)
/ * Oldx, Oldy chess word original location * // * Oldx, oldy chess new location * // * Judgment from the original position to the new position of the legitimacy * / {int index, count = 0; int NOx, Noy; int = X, Y, X1, X2, Y1, Y2; BYTE CHESSID; / * Which of the chess characters, there is RED, Blue, None three values * / chessid = map [oldx] [Oldy] .id; if (ChessID) == None) return 0; if (Oldx == NOWX && loty ======) return 0; if (nowX> 8 || NOWX <0 || NOWY <0 || NOWY> 9) Return 0; NOx = NoWX-Oldx; Noy = no-oldy; switch (map [oldx] [oldy] .num) {case 0: / * headercapital * / will or handsome {ix (map [noWX] [nowy] .num == 0 && map [now] ] .Id! = None && lotx == no = no = = = = = = = = = = nowy; if (NOWY IF (ABS (NOX) == 2 && Map [Oldx NOx / 2] [Oldy] .ID! = none) Return 0; Break;} else return 0;} case 12: case 13: / * gun * / gun {IF (ABS (NOx)> 0 && ABS ((NOY)> 0) RETURN 0; IF (ABS (NOX)> 0 && NoY == 0) {x1 = OLDX; x2 = no (nowx