A Game Courier Preset for Mosaic Chess
12 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11 | |||||||||||||
10 | |||||||||||||
9 | |||||||||||||
8 | |||||||||||||
7 | |||||||||||||
6 | |||||||||||||
5 | |||||||||||||
4 | |||||||||||||
3 | |||||||||||||
2 | |||||||||||||
1 | |||||||||||||
a | b | c | d | e | f | g | h | i | j | k | l |
Rules enforced. Legal moves displayed.
NOTICE: The setup shown here has been modified from the original setup thanks to running code for this game. If this game randomizes the setup, then you may expect to see a different setup when you actually play the game.
Rules of Mosaic Chess
Pieces
The Pawn is a modern chess pawn. It moves one step straight forward and captures one step diagonally forward, and may move two spaces forward from its starting position and capture other pawns en-passant.
The pieces in the third rank are all from Chu Shogi.
The Phoenix moves as a Wazir or Alfil, stepping once straight or leaping two squares diagonally, in any direction.
The Kirin moves as a Ferz or Dabbabah, stepping once diagonally or leaping two squares straight, in any direction.
The Drunk Elephant moves as a King, except it cannot move straight backwards.
The Gold Generaal moves as a King, except it cannot move diagonally backwards.
The Silver General steps diagonally or straight forwards.
The Copper General steps in any of the three forward directions or straight backwards.
The first and second ranks contain pieces from Grant Acedrex and Janggi, along with some modern pieces derived from therefrom.
The Rook slides any distance through the edges of the squares.
The Bombard is the Cannon from Janggi. It moves like the Rook, only it must jump over exactly one other piece, whether moving or capturing.
The Knight in this game makes a 2,1 leap or a 2,0 leap.
The Bishop slides any distance through the corners of the squares.
The Arbalest is to the Bombard what the Bishop is to the Rook. It moves like the Bishop, only it must jump over exactly one other piece, whether moving or capturing.
The Gryphon makes one diagonal step and then slides outward as a Rook.
The Condor is derived from the Gryphon. It first moves as the Alfil, and then continues by sliding outward as a Rook.
The Lion is from Grant Acedrex. It makes a 3,1 leap or a 3,0 leap, in any direction.
The Rhinoceros (Unicorn) is also from Grant Acedrex. It leaps as a Knight and then slides outward as a Bishop.
The Zebra is the Giraffe from Grant Acedrex. Its makes a 3,2 leap.
The Osprey first jumps as a Dabbabah, and then slides outward as a Bishop.
The Queen in this game combines the moves of Rook, Bishop, Bombard, and Arbalest.
The King is just a King. It steps to any of the eight adjacent squares. It has no special jumps or castling moves.
Promotion
Whenever a promotable piece makes a move that ends within the last four ranks of the board from the moving player's perspective, it may promote, but if a Pawn reaches the last rank, it must promote immediately. Each promotable piece can promote to one other piece. The promotable pieces and their promotions are shown below.
Unpromoted | Promoted |
---|---|
Ending the Game
Victory is achieved by Checkmate or Bare King, with Stalemate and double Bare Kings being drawn.
How to Move Pieces
Full Algebraic Notation
Algebraic notation identifies each space by a coordinate that begins with its file label and ends with its rank label. On the Chess board, files go up and down from one player to the other, and ranks go from left to right. In most games, files are represented by letters, and ranks are represented by numbers, but there is no fixed rule requiring this for all games, and some games, such as Shogi, reverse this convention. If you look at the diagram, you will usually see the file labels going from left to right and the file labels going up and down. And if you hover your mouse over a space, you will normally see the name of the coordinate appear in a tooltip.
It is not uncommon to see algebraic notation being used for Chess, but it is often in an abbreviated format that requires you to know both the rules of the game and the current position to know exactly which piece moves where. For example, the notation "Ne6" indicates that a Knight is moving to e6, but it doesn't indicate which Knight, and it doesn't specify where the Knight is coming from. To figure this out, you need to know how a Knight moves and which Knight on the board can make a legal move to e6.
Although rules may be programmed for individual games, Game Courier itself does not know the rules of any game, and it is unable to parse abbreviated algebraic notation. Therefore, it relies on full algebraic notation, which completely specifies the move without requiring any knowledge of the game's rules or the current position. The most usual type of full algebraic notation indicates the piece that is moving by its label, the space it is moving from, and the space it moving to. In Chess, a typical first move might be written as "P e2-e4". When you hover your mouse over a piece, you will normally see the piece label followed by the coordinate for the space, and when you hover it over an empty space, you will normally see the coordinate label. Including the piece label in your notation allows Game Courier to check that the piece you're moving is the right one, and it makes game notation easier to follow, but it is not mandatory.
You may promote a piece by including a promotion move after your regular move. A promotion move has a piece go directly to a coordinate. Here is an example: "p e7-e8; q-e8".
You may remove a piece from a space by adding an @ to the space or by omitting the destination coordinate. For example, both "@-e4" and "e4-" would remove the piece on "e4". This is useful for en passant when you are playing a game that does not handle this automatically. For example, "P d5-e6; e5-" removes the Pawn on e5 after a Pawn moves from d5 to e6.
You will not need to remove spaces for most games, but if you should need to, you can do this by omitting the first coordinate in a move. For example, "-e4" would remove e4 from the board. To add or return a space to the board, you may add an @ or any other piece to it.
Available Pieces
Pieces are represented by labels, usually using uppercase letters for White and lowercase letter for Black. When you enter a move or specify the starting position for a game, you should remember that piece labels are case-sensitive. Many piece sets are available for use with Game Courier, and this table shows you which pieces belong to the piece set you are currently using.
These pieces come from a set containing more pieces, but this preset has had the set of pieces reduced to those used in the game.
Syntax Error on line 0
Each value of the $pieces array should be a string
Edit the Settings File for Mosaic Chess
For the sake of debugging, here is the full GAME Code program that this error occurred in. The lines have been properly indented to help you spot scope errors.
0 include fairychess 1 setsystem groupsets array alfaerie-many 2 set mypieces () 3 set mypieces.k $pieces.k 4 set mypieces.K $pieces.K 5 set mypieces.q $pieces.q 6 set mypieces.Q $pieces.Q 7 set mypieces.r $pieces.r 8 set mypieces.R $pieces.R 9 set mypieces.b $pieces.b 10 set mypieces.B $pieces.B 11 set mypieces.z $pieces.z 12 set mypieces.Z $pieces.Z 13 set mypieces.l $pieces.l 14 set mypieces.L $pieces.L 15 set mypieces.p $pieces.p 16 set mypieces.P $pieces.P 17 if == pieceset alfaerie-many 18 set mypieces.U pieceimg RH 19 set mypieces.u pieceimg rh 20 set mypieces.N pieceimg .ND 21 set mypieces.n pieceimg .nd 22 set mypieces.O pieceimg BI 23 set mypieces.o pieceimg bi 24 set mypieces.Y pieceimg GY 25 set mypieces.y pieceimg gy 26 set mypieces.D pieceimg 1BI 27 set mypieces.d pieceimg 1bi 28 set mypieces.A pieceimg V 29 set mypieces.a pieceimg v 30 set mypieces.M pieceimg C 31 set mypieces.m pieceimg c 32 set mypieces.E pieceimg ~DE 33 set mypieces.e pieceimg ~de 34 set mypieces.G pieceimg G 35 set mypieces.g pieceimg g 36 set mypieces.S pieceimg S 37 set mypieces.s pieceimg s 38 set mypieces.C pieceimg ~CO 39 set mypieces.c pieceimg ~co 40 set mypieces.I pieceimg .DF 41 set mypieces.i pieceimg .df 42 set mypieces.X pieceimg .EW 43 set mypieces.x pieceimg .ew 44 endif 45 setsystem pieces #mypieces 46 setsystem flipped #mypieces 47 add K g1 k g12 X a3 X l3 x a10 x l10 I b3 I k3 i b10 i k10 E c3 E j3 e c10 e j10 G d3 G i3 g d10 g i10 S e3 S h3 s e10 s h10 C f3 C g3 c f10 c g10 M b2 M k2 m b11 m k11 N c2 N j2 n c11 n j11 A e2 A h2 a e11 a h11 Y f2 Y g2 y f11 y g11 D a1 D l1 d a12 d l12 U c1 U j1 u c12 u j12 O e1 O h1 o e12 o h12 48 set kpos findpiece k spaces 49 set Kpos findpiece K spaces 50 set ep false 51 set wpr 4 52 set bpr 9 53 set fps 2 54 set pzs 4 55 set wprom (L) 56 set bprom (l) 57 set promotable N n C c X x S s Z z G g I i E e R r M m B b A a 58 setflag g1 g12 59 setconst p Black_Pawn 60 setconst P White_Pawn 61 setconst i Kirin 62 setconst I Kirin 63 setconst x Phoenix 64 setconst X Phoenix 65 setconst e Black_Drunk_Elephant 66 setconst E White_Drunk_Elephant 67 setconst g Black_Gold_General 68 setconst G White_Gold_General 69 setconst s Black_Silver_General 70 setconst S White_Silver_General 71 setconst c Black_Copper_General 72 setconst C White_Copper_General 73 setconst r Rook 74 setconst R Rook 75 setconst m Bombard 76 setconst M Bombard 77 setconst n Knight 78 setconst N Knight 79 setconst b Bishop 80 setconst B Bishop 81 setconst a Arbalest 82 setconst A Arbalest 83 setconst y Griffon 84 setconst Y Griffon 85 setconst d Condor 86 setconst D Condor 87 setconst l Lion 88 setconst L Lion 89 setconst u Rhinoceros 90 setconst U Rhinoceros 91 setconst z Zebra 92 setconst Z Zebra 93 setconst o Osprey 94 setconst O Osprey 95 setconst q Queen 96 setconst Q Queen 97 setconst K King 98 setconst k King 99 def Kirin checkleap #0 #1 2 0 or checkleap #0 #1 1 1 100 def Kirin-Range mergeall leaps #0 1 1 leaps #0 2 0 101 set Kirin-Desc "The %s moves as a Ferz or Dabbabah, stepping once diagonally or leaping two squares straight, in any direction." 102 def Phoenix checkleap #0 #1 2 2 or checkleap #0 #1 1 0 103 def Phoenix-Range mergeall leaps #0 2 2 leaps #0 1 0 104 set Phoenix-Desc "The %s moves as a Wazir or Alfil, stepping once straight or leaping two squares diagonally, in any direction." 105 def Black_Drunk_Elephant checkleap #0 #1 1 1 or checkaleap #0 #1 1 0 or checkaleap #0 #1 -1 0 or checkaleap #0 #1 0 -1 106 def Black_Drunk_Elephant-Range mergeall leaps #0 1 1 where #0 -1 0 where #0 1 0 where #0 0 -1 107 set Black_Drunk_Elephant-Desc "The %s moves as a King, except it cannot move straight backwards." 108 def White_Drunk_Elephant checkleap #0 #1 1 1 or checkaleap #0 #1 1 0 or checkaleap #0 #1 -1 0 or checkaleap #0 #1 0 1 109 def White_Drunk_Elephant-Range mergeall leaps #0 1 1 where #0 -1 0 where #0 1 0 where #0 0 1 110 set White_Drunk_Elephant-Desc "The %s moves as a King, except it cannot move straight backwards." 111 def Black_Copper_General checkaleap #0 #1 1 -1 or checkaleap #0 #1 0 -1 or checkaleap #0 #1 -1 -1 or checkaleap #0 #1 0 1 112 def Black_Copper_General-Range mergeall where #0 1 -1 where #0 0 -1 where #0 -1 -1 where #0 0 1 113 set Black_Copper_General-Desc "The %s steps in any of the three forward directions or straight backwards." 114 def White_Copper_General checkaleap #0 #1 1 1 or checkaleap #0 #1 0 1 or checkaleap #0 #1 -1 1 or checkaleap #0 #1 0 -1 115 def White_Copper_General-Range mergeall where #0 1 1 where #0 0 1 where #0 -1 1 where #0 0 -1 116 set White_Copper_General-Desc "The %s steps in any of the three forward directions or straight backwards." 117 def Bombard checkhop #0 #1 1 0 118 def Bombard-Range rays #0 1 0 119 set Bombard-Desc "The %s is the Cannon from Janggi. It moves like the Rook, only it must jump over exactly one other piece, whether moving or capturing." 120 def Knight checkleap #0 #1 2 1 or checkleap #0 #1 2 0 121 def Knight-Range mergeall leaps #0 2 1 leaps #0 2 0 122 set Knight-Desc "The %s in this game makes a 2,1 leap or a 2,0 leap." 123 def Arbalest checkhop #0 #1 1 1 124 def Arbalest-Range rays #0 1 1 125 set Arbalest-Desc "The %s is to the Bombard what the Bishop is to the Rook. It moves like the Bishop, only it must jump over exactly one other piece, whether moving or capturing." 126 def Condor fn (checkaride #0 #1 0 1 and empty #0) where #0 2 2 #1 or fn (checkaride #0 #1 1 0 and empty #0) where #0 2 2 #1 or fn (checkaride #0 #1 0 1 and empty #0) where #0 -2 2 #1 or fn (checkaride #0 #1 -1 0 and empty #0) where #0 -2 2 #1 or fn (checkaride #0 #1 0 -1 and empty #0) where #0 -2 -2 #1 or fn (checkaride #0 #1 -1 0 and empty #0) where #0 -2 -2 #1 or fn (checkaride #0 #1 0 -1 and empty #0) where #0 2 -2 #1 or fn (checkaride #0 #1 1 0 and empty #0) where #0 2 -2 #1 or checkleap #0 #1 2 2 127 def Condor-Range mergeall leaps #0 2 2 ray where #0 2 2 0 1 ray where #0 2 2 1 0 ray where #0 -2 2 0 1 ray where #0 -2 2 -1 0 ray where #0 -2 -2 0 -1 ray where #0 -2 -2 -1 0 ray where #0 2 -2 0 -1 ray where #0 2 -2 1 0 128 set Condor-Desc "The %s is derived from the Gryphon. It first moves as the Alfil, and then continues by sliding outward as a Rook." 129 def Lion checkleap #0 #1 3 1 or checkleap #0 #1 3 0 130 def Lion-Range mergeall leaps #0 3 1 leaps #0 3 0 131 def Lion-Desc "The %s is from Grant Acedrex. It makes a 3,1 leap or a 3,0 leap, in any direction." 132 def Rhinoceros fn (checkaride #0 #1 1 1 and empty #0) where #0 1 2 #1 or fn (checkaride #0 #1 1 -1 and empty #0) where #0 1 -2 #1 or fn (checkaride #0 #1 -1 1 and empty #0) where #0 -1 2 #1 or fn (checkaride #0 #1 -1 -1 and empty #0) where #0 -1 -2 #1 or fn (checkaride #0 #1 1 1 and empty #0) where #0 2 1 #1 or fn (checkaride #0 #1 1 -1 and empty #0) where #0 2 -1 #1 or fn (checkaride #0 #1 -1 1 and empty #0) where #0 -2 1 #1 or fn (checkaride #0 #1 -1 -1 and empty #0) where #0 -2 -1 #1 or checkleap #0 #1 2 1 133 def Rhinoceros-Range mergeall leaps #0 2 1 ray where #0 1 2 1 1 ray where #0 1 -2 1 -1 ray where #0 -1 2 -1 1 ray where #0 -1 -2 -1 -1 ray where #0 2 1 1 1 ray where #0 2 -1 1 -1 ray where #0 -2 1 -1 1 ray where #0 -2 -1 -1 -1 134 set Rhinoceros-Desc "TThe %s (Unicorn) is also from Grant Acedrex. It leaps as a Knight and then slides outward as a Bishop." 135 def Osprey fn (checkride #0 #1 1 1 and empty #0) where #0 0 * 2 sign - rank #1 rank #0 #1 or fn (checkride #0 #1 1 1 and empty #0) where #0 * 2 sign - file #1 file #0 0 #1 and not checkleap #0 #1 1 1 or checkleap #0 #1 2 0 136 def Osprey-Range mergeall leaps #0 2 0 rays where #0 0 2 1 1 rays where #0 0 -2 1 1 rays where #0 2 0 1 1 rays where #0 -2 0 1 1 137 set Osprey-Desc "The %s may jump to the second square on the same rank or file, and so long as it is unblocked, it may continue its move in an outward diagonal direction." 138 def Queen fn Rook #0 #1 or fn Bishop #0 #1 or fn Bombard #0 #1 or fn Arbalest #0 #1 139 def Queen-Range merge rays #0 1 0 rays #0 1 1 140 set Queen-Desc "The %s in this game combines the moves of Rook, Bishop, Bombard, and Arbalest." 141 sub Knight from to 142 if isupper $moved and not $answered and == mln $maxmln 143 if onboard where #to 0 #pzs 144 if != space #to $moved 145 die "You may not promote a Knight until it reaches the promotion zone." 146 endif 147 elseif == N space #to 148 askpromote Y $moved 149 elseif not match space #to (Y $moved) 150 set np space #to 151 die "You may not promote your Knight to a" #np 152 endif 153 endif 154 if islower $moved and not $answered and == mln $maxmln 155 if onboard where #to 0 neg #pzs 156 if != space #to $moved 157 die "You may not promote a Knight until it reaches the promotion zone." 158 endif 159 elseif == n space #to 160 askpromote y $moved 161 elseif not match space #to (y $moved) 162 set np space #to 163 die "You may not promote your Knight to a" #np 164 endif 165 endif 166 return true 167 endsub 168 sub White_Copper_General from to 169 if not $answered and == mln $maxmln 170 if < rank #to 8 171 if != space #to $moved 172 die "You may not promote a White_Copper_General until it reaches the promotion zone." 173 endif 174 elseif == C space #to 175 askpromote Y $moved 176 elseif not match space #to (Y $moved) 177 set np space #to 178 die "You may not promote your White_Copper_General to a" #np 179 endif 180 endif 181 return true 182 endsub 183 sub Black_Copper_General from to 184 if not $answered and == mln $maxmln 185 if > rank #to 3 186 if != space #to $moved 187 die "You may not promote a Black_Copper_General until it reaches the promotion zone." 188 endif 189 elseif == c space #to 190 askpromote y $moved 191 elseif not match space #to (y $moved) 192 set np space #to 193 die "You may not promote your Black_Copper_General to a" #np 194 endif 195 endif 196 return true 197 endsub 198 sub Phoenix from to 199 if isupper $moved and not $answered and == mln $maxmln 200 if onboard where #to 0 #pzs 201 if != space #to $moved 202 die "You may not promote a Phoenix until it reaches the promotion zone." 203 endif 204 elseif == X space #to 205 askpromote D $moved 206 elseif not match space #to (D $moved) 207 set np space #to 208 die "You may not promote your Phoenix to a" #np 209 endif 210 endif 211 if islower $moved and not $answered and == mln $maxmln 212 if onboard where #to 0 neg #pzs 213 if != space #to $moved 214 die "You may not promote a Phoenix until it reaches the promotion zone." 215 endif 216 elseif == x space #to 217 askpromote d $moved 218 elseif not match space #to (d $moved) 219 set np space #to 220 die "You may not promote your Phoenix to a" #np 221 endif 222 endif 223 return true 224 endsub 225 sub White_Silver_General from to 226 if not $answered and == mln $maxmln 227 if < rank #to 8 228 if != space #to $moved 229 die "You may not promote a White_Silver_General until it reaches the promotion zone." 230 endif 231 elseif == S space #to 232 askpromote D $moved 233 elseif not match space #to (D $moved) 234 set np space #to 235 die "You may not promote your White_Silver_General to a" #np 236 endif 237 endif 238 return true 239 endsub 240 sub Black_Silver_General from to 241 if not $answered and == mln $maxmln 242 if > rank #to 3 243 if != space #to $moved 244 die "You may not promote a Black_Silver_General until it reaches the promotion zone." 245 endif 246 elseif == s space #to 247 askpromote d $moved 248 elseif not match space #to (d $moved) 249 set np space #to 250 die "You may not promote your Black_Silver_General to a" #np 251 endif 252 endif 253 return true 254 endsub 255 sub Zebra from to 256 if isupper $moved and not $answered and == mln $maxmln 257 if onboard where #to 0 #pzs 258 if != space #to $moved 259 die "You may not promote a Zebra until it reaches the promotion zone." 260 endif 261 elseif == Z space #to 262 askpromote U $moved 263 elseif not match space #to (U $moved) 264 set np space #to 265 die "You may not promote your Zebra to a" #np 266 endif 267 endif 268 if islower $moved and not $answered and == mln $maxmln 269 if onboard where #to 0 neg #pzs 270 if != space #to $moved 271 die "You may not promote a Zebra until it reaches the promotion zone." 272 endif 273 elseif == z space #to 274 askpromote u $moved 275 elseif not match space #to (u $moved) 276 set np space #to 277 die "You may not promote your Zebra to a" #np 278 endif 279 endif 280 return true 281 endsub 282 sub White_Gold_General from to 283 if not $answered and == mln $maxmln 284 if < rank #to 8 285 if != space #to $moved 286 die "You may not promote a White_Gold_General until it reaches the promotion zone." 287 endif 288 elseif == G space #to 289 askpromote U $moved 290 elseif not match space #to (U $moved) 291 set np space #to 292 die "You may not promote your White_Gold_General to a" #np 293 endif 294 endif 295 return true 296 endsub 297 sub Black_Gold_General from to 298 if not $answered and == mln $maxmln 299 if > rank #to 3 300 if != space #to $moved 301 die "You may not promote a Black_Gold_General until it reaches the promotion zone." 302 endif 303 elseif == g space #to 304 askpromote u $moved 305 elseif not match space #to (u $moved) 306 set np space #to 307 die "You may not promote your Black_Gold_General to a" #np 308 endif 309 endif 310 return true 311 endsub 312 sub Kirin from to 313 if isupper $moved and not $answered and == mln $maxmln 314 if onboard where #to 0 #pzs 315 if != space #to $moved 316 die "You may not promote a Kirin until it reaches the promotion zone." 317 endif 318 elseif == I space #to 319 askpromote O $moved 320 elseif not match space #to (O $moved) 321 set np space #to 322 die "You may not promote your Kirin to a" #np 323 endif 324 endif 325 if islower $moved and not $answered and == mln $maxmln 326 if onboard where #to 0 neg #pzs 327 if != space #to $moved 328 die "You may not promote a Kirin until it reaches the promotion zone." 329 endif 330 elseif == i space #to 331 askpromote o $moved 332 elseif not match space #to (o $moved) 333 set np space #to 334 die "You may not promote your Kirin to a" #np 335 endif 336 endif 337 return true 338 endsub 339 sub White_Drunk_Elephant from to 340 if not $answered and == mln $maxmln 341 if < rank #to 8 342 if != space #to $moved 343 die "You may not promote a White_Drunk_Elephant until it reaches the promotion zone." 344 endif 345 elseif == E space #to 346 askpromote O $moved 347 elseif not match space #to (O $moved) 348 set np space #to 349 die "You may not promote your White_Drunk_Elephant to a" #np 350 endif 351 endif 352 return true 353 endsub 354 sub Black_Drunk_Elephant from to 355 if not $answered and == mln $maxmln 356 if > rank #to 3 357 if != space #to $moved 358 die "You may not promote a Black_Drunk_Elephant until it reaches the promotion zone." 359 endif 360 elseif == e space #to 361 askpromote o $moved 362 elseif not match space #to (o $moved) 363 set np space #to 364 die "You may not promote your Black_Drunk_Elephant to a" #np 365 endif 366 endif 367 return true 368 endsub 369 sub Arbalest from to 370 if isupper $moved and not $answered and == mln $maxmln 371 if onboard where #to 0 #pzs 372 if != space #to $moved 373 die "You may not promote a Arbalest until it reaches the promotion zone." 374 endif 375 elseif == A space #to 376 askpromote Q $moved 377 elseif not match space #to (Q $moved) 378 set np space #to 379 die "You may not promote your Arbalest to a" #np 380 endif 381 endif 382 if islower $moved and not $answered and == mln $maxmln 383 if onboard where #to 0 neg #pzs 384 if != space #to $moved 385 die "You may not promote a Arbalest until it reaches the promotion zone." 386 endif 387 elseif == a space #to 388 askpromote q $moved 389 elseif not match space #to (q $moved) 390 set np space #to 391 die "You may not promote your Arbalest to a" #np 392 endif 393 endif 394 return true 395 endsub 396 sub Bishop from to 397 if isupper $moved and not $answered and == mln $maxmln 398 if onboard where #to 0 #pzs 399 if != space #to $moved 400 die "You may not promote a Bishop until it reaches the promotion zone." 401 endif 402 elseif == B space #to 403 askpromote Q $moved 404 elseif not match space #to (Q $moved) 405 set np space #to 406 die "You may not promote your Bishop to a" #np 407 endif 408 endif 409 if islower $moved and not $answered and == mln $maxmln 410 if onboard where #to 0 neg #pzs 411 if != space #to $moved 412 die "You may not promote a Bishop until it reaches the promotion zone." 413 endif 414 elseif == b space #to 415 askpromote q $moved 416 elseif not match space #to (q $moved) 417 set np space #to 418 die "You may not promote your Bishop to a" #np 419 endif 420 endif 421 return true 422 endsub 423 sub Bombard from to 424 if isupper $moved and not $answered and == mln $maxmln 425 if onboard where #to 0 #pzs 426 if != space #to $moved 427 die "You may not promote a Bombard until it reaches the promotion zone." 428 endif 429 elseif == M space #to 430 askpromote Q $moved 431 elseif not match space #to (Q $moved) 432 set np space #to 433 die "You may not promote your Bombard to a" #np 434 endif 435 endif 436 if islower $moved and not $answered and == mln $maxmln 437 if onboard where #to 0 neg #pzs 438 if != space #to $moved 439 die "You may not promote a Bombard until it reaches the promotion zone." 440 endif 441 elseif == m space #to 442 askpromote q $moved 443 elseif not match space #to (q $moved) 444 set np space #to 445 die "You may not promote your Bombard to a" #np 446 endif 447 endif 448 return true 449 endsub 450 sub Rook from to 451 if isupper $moved and not $answered and == mln $maxmln 452 if onboard where #to 0 #pzs 453 if != space #to $moved 454 die "You may not promote a Rook until it reaches the promotion zone." 455 endif 456 elseif == R space #to 457 askpromote Q $moved 458 elseif not match space #to (Q $moved) 459 set np space #to 460 die "You may not promote your Rook to a" #np 461 endif 462 endif 463 if islower $moved and not $answered and == mln $maxmln 464 if onboard where #to 0 neg #pzs 465 if != space #to $moved 466 die "You may not promote a Rook until it reaches the promotion zone." 467 endif 468 elseif == r space #to 469 askpromote q $moved 470 elseif not match space #to (q $moved) 471 set np space #to 472 die "You may not promote your Rook to a" #np 473 endif 474 endif 475 return true 476 endsub 477 setsystem originalpieces currentpieces 478 set cap unique keys capturedpieces 479 sub postauto1 480 if not isconst alias $moved 481 die The piece moved is undefined. 482 elseif isupper $old 483 die You may not capture your own pieces. 484 elseif islower alias $moved 485 die You may not move one of your opponent's pieces. 486 endif 487 if != const alias $moved White_Pawn 488 set ep false 489 if and not match $moved promotable != alias space $dest alias $moved 490 die You may not change the type of this piece. 491 elseif capture 492 set nopvc 0 493 else 494 inc nopvc 495 endif 496 endif 497 set codename const alias $moved 498 if sub #codename $origin $dest and issub #codename 499 elseif fn #codename $origin $dest and isfunc #codename and not issub #codename 500 else 501 set name alias #codename 502 set errmsg list "You may not move your" #name "from" $origin "to" join $dest ".
" 503 set desc join #codename "-Desc" 504 set errmsg str_replace "_" " " join #errmsg str_replace "%s" #name var #desc 505 die #errmsg 506 endif 507 if == moved K 508 unsetflag g1 509 set Kpos $dest 510 endif 511 if sub checked var Kpos 512 die You may not move into check. 513 endif 514 unsetflag $origin $dest 515 set posvar join "w" join fencode boardflags 516 inc #posvar 517 set cap unique keys capturedpieces 518 endsub 519 sub postauto2 520 if not isconst alias $moved 521 die The piece alias $moved is undefined. 522 elseif islower $old 523 die You may not capture your own pieces. 524 elseif isupper alias $moved 525 die You may not move one of your opponent's pieces. 526 endif 527 if != const alias $moved Black_Pawn 528 set ep false 529 if and not match $moved promotable != alias space $dest alias $moved 530 die You may not change the typpe of this piece. 531 elseif capture 532 set nopvc 0 533 else 534 inc nopvc 535 endif 536 endif 537 set codename const alias $moved 538 if sub #codename $origin $dest and issub #codename 539 elseif fn #codename $origin $dest and isfunc #codename and not issub #codename 540 else 541 set name alias #codename 542 set errmsg list "You may not move your" #name "from" $origin "to" join $dest ".
" 543 set desc join #codename "-Desc" 544 set errmsg str_replace "_" " " join #errmsg str_replace "%s" #name var #desc 545 die #errmsg 546 endif 547 if == moved k 548 unsetflag g12 549 set kpos $dest 550 endif 551 if sub checked var kpos 552 die You may not move into check. 553 endif 554 unsetflag $origin $dest 555 set posvar join "b" join fencode boardflags 556 inc #posvar 557 set cap unique keys capturedpieces 558 endsub 559 set posvar join "b" join fencode boardflags 560 if >= var #posvar 3 561 say Three Times Repetition! Drawn Game! 562 drawn 563 elseif sub stalemated var Kpos 564 if sub checked var Kpos 565 say Checkmate! Black has won! 566 won 567 else 568 say Stalemate! The game is drawn. 569 drawn 570 endif 571 elseif >= #nopvc 100 572 say Fifty Moves Without Moving a Pawn or Capturing! Game Drawn! 573 drawn 574 elseif sub checked var Kpos 575 say Check! 576 endif 577 if == 1 count onlyupper and == status Ongoing 578 set mypieces onlylower 579 switch count #mypieces 580 case 1 581 say Both Kings Bared! Game Drawn! 582 drawn 583 break 584 case 2 585 foreach (from piece) #mypieces 586 if == #piece k 587 continue 588 elseif not fn King #K #from or fn King #k #from 589 say Bare King!! Black Wins!! 590 won 591 break 592 else 593 say Both Kings Bared on Next Move! Game Drawn! 594 drawn 595 break 596 endif 597 next 598 break 599 default 600 say Bare King! White Wins! 601 won 602 break 603 endswitch 604 endif 605 end 606 end 607 608 lib fairychess 609 if flag use-chess-defaults 610 setconst k King 611 setconst K King 612 setconst q Queen 613 setconst Q Queen 614 setconst r Rook 615 setconst R Rook 616 setconst b Bishop 617 setconst B Bishop 618 setconst n Knight 619 setconst N Knight 620 setconst p Black_Pawn 621 setconst P White_Pawn 622 endif 623 if flag use-chess-defaults 624 set wpr 2 625 set bpr 7 626 set fps 2 627 set pzs 1 628 set wcastle c1 g1 629 set bcastle c8 g8 630 set wprom Q R B N 631 set bprom q r b n 632 set promotable p P 633 elseif not isset wpr 634 set message join "Set the wpr variable to the value of White's Pawn Rank. This is the single rank on which all of White's Pawns start. This would be 2 for Chess.
" var message 635 elseif not isset bpr 636 set message join "Set the bpr variable to the value of Black's Pawn Rank. This is the single rank on which all of Black's Pawns start. This would be 7 for Chess.
" var message 637 elseif not isset fps 638 set message join "Set the fps variable to the value of the maximum number of spaces a Pawn may move on its first move. This would be 2 in Chess.
" var message 639 elseif not isset pzs 640 set message join "Set the pzs variable to the value of the Promotion Zone Size. This is the number of ranks on the opposite side of the board on which Pawns may promote. This would be 1 for Chess.
" var message 641 elseif not isset wcastle 642 set message join "Set the wcastle variable to a space-separated list of the coordinates of the spaces the White King may move to when castling. This would be c1 g1 for Chess.
" var message 643 elseif not isset bcastle 644 set message join "Set the bcastle variable to a space-separated list of the coordinates of the spaces the Black King may move to when castling. This would be c8 g8 for Chess.
" var message 645 elseif not isset wprom 646 set message join "Set the wprom variable to the pieces that a White Pawn may promote to on reaching the Promotion Zone. White's pieces will normally be uppercase, and this would be Q R B N for Chess.
" var message 647 elseif not isset bprom 648 set message join "Set the bprom variable to the pieces that a Black Pawn may promote to on reaching the Promotion Zone. Black's pieces will normally be lowercase, and this would be q r b n for Chess.
" var message 649 endif 650 set ep false 651 setsystem maxmove 2 652 ban commands allmoves 653 allow moves 1 captures 1 promotions 2 654 set Aanca-Desc "The %s may move one space orthgonally, and so long as it is unblocked, it may continue its move in an outward diagonal direction." 655 def Aanca fn (checkride #0 #1 1 1 and empty #0) where #0 0 sign - rank #1 rank #0 #1 or fn (checkride #0 #1 1 1 and empty #0) where #0 sign - file #1 file #0 0 #1 or checkleap #0 #1 1 0 656 def Aanca-Range mergeall leaps #0 1 0 rays where #0 0 1 1 1 rays where #0 0 -1 1 1 rays where #0 1 0 1 1 rays where #0 -1 0 1 1 657 set Amazon-Desc "The %s may move in a straight line in any direction, as a Queen does, or it may leap the the opposite end of a 1x2 rectangle, as a Knight does." 658 def Amazon fn Bishop #0 #1 or fn Rook #0 #1 or fn Knight #0 #1 659 def Amazon-Range merge leaps # 1 2 merge rays #0 1 0 rays #0 1 1 660 set Bede-Desc "The %s may move along any diagonal line, as a Bishop does, or it may leap two spaces away in any orthogonal direction, as a Dabababah does." 661 def Bede checkride #0 #1 1 1 or checkleap #0 #1 0 2 662 def Bede-Range merge rays #0 1 1 leaps #0 0 2 663 def White_Berolina_Pawn remove var epc and checkleap #0 #1 1 0 and == #1 var epp or and checkride #0 #1 1 1 == rankname #0 var wpr or checkleap #0 #1 1 1 and empty #1 or and islower space #1 checkleap #0 #1 1 0 and <= distance #0 #1 var fps and > rank #1 rank #0 664 def Black_Berolina_Pawn remove var epc and checkleap #0 #1 1 0 and == #1 var epp or and checkride #0 #1 1 1 == rankname #0 var bpr or checkleap #0 #1 1 1 and empty #1 or and isupper space #1 checkleap #0 #1 1 0 and <= distance #0 #1 var fps and < rank #1 rank #0 665 def White_Berolina_Pawn-Range filter lambda (onboard #1) mergeall where #ori 0 1 values lambda (where #ori neg #1 #1) range 1 var fps values lambda (where #ori #1 #1) range 1 var fps =ori 666 def Black_Berolina_Pawn-Range filter lambda (onboard #1) mergeall where #ori 0 -1 values lambda (where #ori neg #1 neg #1) range 1 var fps values lambda (where #ori #1 neg #1) range 1 var fps =ori 667 set White_Berolina_Pawn-Desc "The %s may move one space diagonally forward without capturing, or it may move one space straight forward to capture. On its first move, it may move two spaces diagonally forward without capturing so long as it isn't blocked. If this move takes it next to an enemy %s that could have captured it if it had just moved one space, that %s may immediately capture it by en passant, moving to the space it passed over. On reaching the last rank, it may promote." 668 set Black_Berolina_Pawn-Desc var White_Berolina_Pawn-Desc 669 sub White_Berolina_Pawn from to 670 verify > rank #to rank #from 671 verify <= distance #to #from #fps 672 if capture 673 verify checkleap #from #to 1 0 674 set epp false 675 set epc false 676 elseif checkleap #from #to 1 0 and == #to #epp 677 capture #epc 678 set epp false 679 set epc false 680 elseif > distance #to #from 1 681 verify == rankname #from #wpr 682 verify checkride #from #to 1 1 683 set epp elem 0 path #from #to 684 set epc #to 685 else 686 verify checkleap #from #to 1 1 687 set epp false 688 set epc false 689 endif 690 if onboard where #to 0 #pzs 691 if != space #to $moved 692 set name alias const alias $moved 693 die "You may not promote a" #name "until it reaches the promotion zone." 694 endif 695 elseif onboard where #to 0 1 696 if == White_Berolina_Pawn const alias space #to and count var wprom 697 if not $answered and == mln $maxmln 698 push wprom space #to 699 askpromote #wprom 700 endif 701 elseif not match space #to var wprom and != White_Pawn const alias space #to 702 set name alias const alias $moved 703 set newname alias const alias space #to 704 set msg list "You may not promote your" #name "to a" join #newname ".
" 705 set msg str_replace "_" " " var msg 706 die #msg 707 endif 708 elseif count var wprom 709 if == White_Berolina_Pawn const alias space #to 710 if == count var wprom 1 711 set newpiece join list var wprom 712 set newmove join #newpiece "-dest" 713 add #newpiece $dest 714 appendmove #newmove 715 else 716 askpromote #wprom 717 endif 718 elseif not match space #to var wprom 719 set name alias const alias $moved 720 set newname alias const alias space #to 721 set msg list "You may not promote your" #name "to a" join #newname ".
" 722 set msg str_replace "_" " " var msg 723 die #msg 724 endif 725 else 726 set name alias const alias $moved 727 set msg list "You may not advance your" #name "to the last rank, because there is nothing you may promote it to." 728 set msg str_replace "_" " " var msg 729 die #msg 730 endif 731 set nopvc 0 732 return true 733 endsub 734 sub Black_Berolina_Pawn from to 735 verify < rank #to rank #from 736 verify <= distance #to #from #fps 737 if capture 738 verify checkleap #from #to 1 0 739 set epp false 740 set epc false 741 elseif checkleap #from #to 1 0 and == #to #epp 742 capture #epc 743 set epp false 744 set epc false 745 elseif > distance #to #from 1 746 verify == rankname #from #bpr 747 verify checkride #from #to 1 1 748 set epp elem 0 path #from #to 749 set epc #to 750 else 751 verify checkleap #from #to 1 1 752 set epp false 753 set epc false 754 endif 755 if onboard where #to 0 neg #pzs 756 if != space #to $moved 757 set name alias const alias $moved 758 die "You may not promote a" #name "until it reaches the promotion zone." 759 endif 760 elseif onboard where #to 0 -1 761 if == Black_Berolina_Pawn const alias space #to and count var bprom 762 if not $answered and == mln $maxmln 763 push bprom space #to 764 askpromote #bprom 765 endif 766 elseif not match space #to var bprom and != Black_Pawn const alias space #to 767 set name alias const alias $moved 768 set newname alias const alias space #to 769 set msg list "You may not promote your" #name "to a" join #newname ".
" 770 set msg str_replace "_" " " var msg 771 die #msg 772 endif 773 elseif count var bprom 774 if == Black_Berolina_Pawn const alias space #to 775 if == count var bprom 1 776 set newpiece join list var bprom 777 set newmove join #newpiece "-dest" 778 add #newpiece $dest 779 appendmove #newmove 780 else 781 askpromote #bprom 782 endif 783 elseif not match space #to var bprom 784 set name alias const alias $moved 785 set newname alias const alias space #to 786 set msg list "You may not promote your" #name "to a" join #newname ".
" 787 set msg str_replace "_" " " var msg 788 die #msg 789 endif 790 else 791 set name alias const alias $moved 792 set msg list "You may not advance your" #name "to the last rank, because there is nothing you may promote it to." 793 set msg str_replace "_" " " var msg 794 die #msg 795 endif 796 set nopvc 0 797 return true 798 endsub 799 def Bishop checkride #0 #1 1 1 800 def Bishop-Range rays #0 1 1 801 set Bishop-Desc "The %s may move diagonally any number of spaces until it reaches an occupied space." 802 def Cannon cond cond empty #0 capture (not empty #1) (checkhop #0 #1 0 1) (checkride #0 #1 0 1) and #1 803 def Cannon-Range rays #0 1 0 804 set Cannon-Desc "The %s moves any number of spaces orthogonally, as a Rook does, but it must hop over an intervening piece to capture." 805 def Camel checkleap #0 #1 1 3 806 def Camel-Range leaps #0 1 3 807 set Camel-Desc "The %s leaps to any space at the opposite corner of a 1x3 rectangle." 808 def Camelrider checkride #0 #1 1 3 809 def Camelrider-Range rays #0 1 3 810 set Camelrider-Desc "The %s may make any number of Camel moves in the same direction until it lands on an occupied space." 811 def Cardinal fn Bishop #0 #1 or fn Knight #0 #1 812 def Cardinal-Range merge leaps #0 1 2 rays #0 1 1 813 set Cardinal-Desc "The %s may move along diagonals as a Bishop or leap as a Knight." 814 def Centaur checkleap #0 #1 1 1 or checkleap #0 #1 1 0 or checkleap #0 #1 1 2 815 def Centaur-Range merge leaps #0 1 2 merge leaps #0 1 0 leaps #0 1 1 816 set Centaur-Desc "The %s may move to any adjacent space as a King or leap like a Knight." 817 def Champion fn Elephant #0 #1 or fn Dabbabah #0 #1 or fn Wazir #0 #1 818 def Champion-Range mergeall leaps #0 2 2 leaps #0 2 0 leaps #0 1 0 819 set Champion-Desc "The %s may leap one or two spaces orthogonally or two spaces diagonally." 820 def White_Charging_Knight cond < rank #0 rank #1 (checkleap #0 #1 1 2) (checkleap #0 #1 1 1 or checkleap #0 #1 1 0) 821 def White_Charging_Knight-Range mergeall leaps #0 1 2 leaps #0 1 1 leaps #0 1 0 822 set White_Charging_Knight-Desc "The %s may leap forward as a Knight or move one space sideways or backwards like a King." 823 def Black_Charging_Knight cond > rank #0 rank #1 (checkleap #0 #1 1 2) (checkleap #0 #1 1 1 or checkleap #0 #1 1 0) 824 def Black_Charging_Knight-Range mergeall leaps #0 1 2 leaps #0 1 1 leaps #0 1 0 825 set Black_Charging_Knight-Desc "The %s may leap forward as a Knight or move one space sideways or backwards like a King." 826 def White_Charging_Rook checkride #0 #1 1 0 and <= rank #0 rank #1 or checkaleap #0 #1 -1 -1 or checkaleap #0 #1 -1 0 or checkaleap #0 #1 -1 1 827 def White_Charging_Rook-Range mergeall ray #0 0 -1 ray #0 1 0 ray #0 0 1 where #0 -1 1 where #0 1 0 where #0 1 1 828 set White_Charging_Rook-Desc "The %s may move forward or sideways along its file or rank like a Rook, or it may move one space backwards in any direction like a King." 829 def Black_Charging_Rook checkride #0 #1 1 0 and >= rank #0 rank #1 or checkaleap #0 #1 -1 1 or checkaleap #0 #1 1 0 or checkaleap #0 #1 1 1 830 def Black_Charging_Rook-Range mergeall ray #0 0 -1 ray #0 -1 0 ray #0 0 1 where #0 -1 1 where #0 1 0 where #0 1 1 831 set Black_Charging_Rook-Desc "The %s may move forward or sideways along its file or rank like a Rook, or it may move one space backwards in any direction like a King." 832 def Chinese_Elephant checkpath #0 #1 1 1 1 1 833 def Chinese_Elephant-Range leaps #0 2 2 834 set Chinese_Elephant-Desc "The %s may move two spaces diagonally so long as the space in between is empty." 835 def White_Chinese_Elephant checkpath #0 #1 1 1 1 1 and < rank #1 + 1 / lastrank 2 836 def White_Chinese_Elephant-Range leaps #0 2 2 837 set White_Chinese_Elephant-Desc "The %s may move two spaces diagonally so long as the space in between is empty, but it is confined to the ranks on its own side of the board." 838 def Black_Chinese_Elephant checkpath #0 #1 1 1 1 1 and >= rank #1 + 1 / lastrank 2 839 def Black_Chinese_Elephant-Range leaps #0 2 2 840 set Black_Chinese_Elephant-Desc "The %s may move two spaces diagonally so long as the space in between is empty, but it is confined to the ranks on its own side of the board." 841 def Chinese_General checkride #0 #1 1 0 and == Chinese_General const alias cond empty #0 capture space #1 or checkleap #0 #1 0 1 and flag #1 842 def Chinese_General checkride #0 #1 1 0 and == Chinese_General const alias cond empty #0 capture space #1 or checkleap #0 #1 0 1 and flag #1 843 def Chinese_General == distance #0 #1 1 or == var movetype CHECK and checkride #0 #1 1 0 and flag #1 844 def Chinese_General-Range leaps #0 1 0 845 set Chinese_General-Desc "The %s may move one space orthogonally within the confines of the Palace, but it may not face the opponent's %s along an open file." 846 def Chinese_Guard checkleap #0 #1 1 1 and flag #1 847 def Chinese_Guard-Range leaps #0 1 1 848 set Chinese_Guard-Desc "The %s may move one space diagonally within the confines of the palace." 849 def White_Chinese_Pawn checkaleap #0 #1 -1 0 or checkaleap #0 #1 1 0 and >= rank #0 + 1 / lastrank 2 or checkaleap #0 #1 0 1 850 def Black_Chinese_Pawn checkaleap #0 #1 -1 0 or checkaleap #0 #1 1 0 and < rank #0 + 1 / lastrank 2 or checkaleap #0 #1 0 -1 851 def White_Chinese_Pawn-Range leaps #0 1 0 852 def Black_Chinese_Pawn-Range leaps #0 1 0 853 set White_Chinese_Pawn-Desc "The %s may move one space forward. Once it has reached the other side of the board, it may also move one space sideways." 854 set Black_Chinese_Pawn-Desc "The %s may move one space forward. Once it has reached the other side of the board, it may also move one space sideways." 855 def White_Colonel checkride #0 #1 1 0 or checkleap #0 #1 1 2 and >= rank #1 rank #0 or checkleap #0 #1 1 1 or checkleap #0 #1 1 0 856 def White_Colonel mergeall rays #0 1 0 leaps #0 1 2 leaps #0 1 1 857 set White_Colonel-Desc "The %s may move forward or sideways as a Rook, forward as a Knight, and one space in any direction as a King." 858 def Black_Colonel checkride #0 #1 1 0 or checkleap #0 #1 1 2 and <= rank #1 rank #0 or checkleap #0 #1 1 1 or checkleap #0 #1 1 0 859 def Black_Colonel mergeall rays #0 1 0 leaps #0 1 2 leaps #0 1 1 860 set Black_Colonel-Desc "The %s may move forward or sideways as a Rook, forward as a Knight, and one space in any direction as a King." 861 def Dabbabah checkleap #0 #1 0 2 862 def Dabbabah-Range leaps #0 0 2 863 set Dabbabah-Desc "The %s may leap two spaces vertically or horizontally." 864 def Dabbabahrider checkride #0 #1 0 2 865 def Dabbabahrider-Range rays #0 0 2 866 set Dabbabahrider-Desc "The %s may make any number of two space orthogonal leaps in the same direction until it reaches an occupied space." 867 def Dragon_Horse checkride #0 #1 1 1 or checkleap #0 #1 1 0 868 def Dragon_Horse-Range merge leaps #0 1 0 rays #0 1 1 869 set Dragon_Horse-Desc "The %s may move along diagonals as a Bishop or move one space orthogonally as a Wazir." 870 def Dragon_King checkride #0 #1 1 0 or checkleap #0 #1 1 1 871 def Dragon_King-Range merge leaps #0 1 1 rays #0 1 0 872 set Dragon_King-Desc "The %s may move along its rank or file as a Rook or one space diagonally as a Ferz." 873 def Elephant checkleap #0 #1 2 2 874 def Elephant-Range leaps #0 2 2 875 set Elephant-Desc "The %s may leap two spaces in any diagonal direction." 876 def Elephantrider checkride #0 #1 2 2 877 def Elephantrider-Range rays #0 2 2 878 set Elephantrider-Desc "The %s may make a series of two-space diagonal leaps in the same direction. Each leap but the last must be to an empty space, though a leap may take it over an intervening piece." 879 def Eques_Rex checkleap #0 #1 1 1 or checkleap #0 #1 1 0 or checkleap #0 #1 1 2 880 def Eques_Rex-Range merge leaps #0 1 2 merge leaps #0 1 0 leaps #0 1 1 881 set Eques_Rex-Desc "The %s may move to any adjacent space as a King or leap like a Knight." 882 def Fad checkleap #0 #1 1 1 or checkleap #0 #1 2 2 or checkleap #0 #1 2 0 883 def Fad-Range mergeall leaps #0 1 1 leaps #0 2 2 leaps #0 2 0 884 set Fad-Desc "The %s may move one space diagonally, or it may leap two spaces diagonally or orthogonally." 885 def Ferz checkleap #0 #1 1 1 886 def Ferz-Range leaps #0 1 1 887 set Ferz-Desc "The %s may move one space diagonally." 888 def Fibnif checkleap #0 #1 1 2 or checkleap #0 #1 1 1 and == 1 abs - file #0 file #1 889 def Fibnif-Range merge leaps #0 1 2 leaps #0 1 1 890 set Fibnif-Desc "The %s may move one space diagonally or leap as a Knight to any space that is one file and two ranks away." 891 def Giraffe checkleap #0 #1 1 4 892 def Giraffe-Range leaps #0 1 4 893 set Giraffe-Desc "The %s may leap to any space that is one file and four ranks or one rank and four files away." 894 def White_Gold_General checkaleap #0 #1 1 1 or checkaleap #0 #1 -1 1 or checkleap #0 #1 0 1 895 def White_Gold_General-Range mergeall leaps #0 1 0 where #0 1 1 where #0 -1 1 896 set White_Gold_General-Desc "The %s may move one space in any orthgonal direction or one space diagonally forward." 897 def Black_Gold_General checkaleap #0 #1 1 -1 or checkaleap #0 #1 -1 -1 or checkleap #0 #1 0 1 898 def Black_Gold_General-Range mergeall leaps #0 1 0 where #0 1 -1 where #0 -1 -1 899 set Black_Gold_General-Desc "The %s may move one space in any orthgonal direction or one space diagonally forward." 900 def Grasshopper checkgrasshop #0 #1 1 1 or checkgrasshop #0 #1 1 0 901 def Grasshopper-Range merge rays #0 1 0 rays #0 1 1 902 set "The %s moves any number of spaces orthogonally or diagonally like a Queen except that it must hop over exactly one piece, and it must end its move immediately after the piece it hopped over." 903 def Griffon fn (checkride #0 #1 1 0 and empty #0) where #0 sign - file #1 file #0 sign - rank #1 rank #0 #1 and != file #1 file #0 and != rank #1 rank #0 or checkleap #0 #1 1 1 904 def Griffon-Range mergeall leaps #0 1 1 rays where #0 1 1 1 0 rays where #0 1 -1 1 0 rays where #0 -1 -1 1 0 rays where #0 -1 1 1 0 905 set Griffon-Desc "The %s may move one space diagonally, and it may continue its move by moving as a Rook in an outward orthogonal direction. It may not pass over other pieces." 906 def King checkleap #0 #1 1 1 or checkleap #0 #1 1 0 907 def King-Range merge leaps #0 1 0 leaps #0 1 1 908 set King-Desc "The %s leaps one space in any direction. It may castle with a Rook on its first move so long as it is not in check, there is nothing in between it and the Rook, it doesn't pass through check while castling, and the Rook hasn't moved. In castling, it moves two spaces toward the Rook, and the Rook moves to the space the %s passed over." 909 sub King from to 910 if not fn King #from #to 911 verify sub castle #from #to and match #to var cond isupper space #to wcastle bcastle 912 endif 913 if isupper space #to 914 set Kpos #to 915 else 916 set kpos #to 917 endif 918 return true 919 endsub 920 def Knight checkleap #0 #1 1 2 921 def Knight-Range leaps #0 1 2 922 set Knight-Desc "The %s may leap to any space that is one rank and two files away or two ranks and one file away." 923 def Korean_Elephant checkpath #0 #1 1 0 1 1 1 1 924 def Korean_Elephant-Range leaps #0 2 3 925 set "The %s may move one space orthogonally, followed by two more spaces in the same outward diagonal direction. It must complete every part of its move, and it may not pass over an occupied space." 926 def White_Lance checkaride #0 #1 0 1 927 def White_Lance-Range ray #0 0 1 928 set "The %s may move forward in its file as a Rook." 929 def Black_Lance checkaride #0 #1 0 -1 930 def Black_Lance-Range ray #0 0 -1 931 set "The %s may move forward in its file as a Rook." 932 def Leo fn Vao #0 #1 or fn Cannon #0 #1 933 def Leo-Range merge rays #0 1 0 rays #0 1 1 934 set Leo-Desc "The %s may move any number of spaces diagonally or orthogonally, as a Queen does, but it must hop over one intervening piece when it captures." 935 def Mao checktwostep #0 #1 0 1 1 1 936 def Mao-Range leaps #0 1 2 937 set Mao-Desc "The %s moves one space orthogonally, followed by one more space in an outward diagonal direction. It must complete both parts of its move, and it may not pass over an occupied space. It can reach the same spaces as a Knight except that it can be blocked on the first step of its two-space move." 938 def Marshall fn Knight #0 #1 or fn Rook #0 #1 939 def Marshall-Range merge rays #0 1 0 leaps #0 1 2 940 set Marshall-Desc "The %s moves orthogonally as a Rook or leaps as a Knight." 941 def Moa checktwostep #0 #1 1 1 0 1 942 def Moa-Range leaps #0 1 2 943 set Moa-Desc "The %s moves one space diagonally, followed by one more space in an outward orthogonal direction. It must complete both parts of its move, and it may not pass over an occupied space. It can reach the same spaces as a Knight except that it can be blocked on the first step of its two-space move." 944 def Murray_Lion checkleap #0 #1 1 0 or checkleap #0 #1 1 1 and cond empty #0 capture (not empty #1) or checkleap #0 #1 2 2 or checkleap #0 #1 0 2 945 def Murray_Lion-Range merge merge leaps #0 2 0 leaps #0 2 2 merge leaps #0 1 0 leaps #0 1 1 946 set Murray_Lion-Desc "The %s may leap two spaces in any diagonal or orthogonal direction, and it may capture (but not otherwise move) one space in any direction." 947 def Nightrider checkride #0 #1 1 2 948 def Nightrider-Range rays #0 1 2 949 set Nightrider-Desc "The %s may leap as a Knight any number of times in the same direction. While each Knight leap may take it over other pieces, each leap but the last must be to an empty space." 950 set White_Pawn-Desc "The %s may move one space straight forward without capturing, or it may move one space diagonally forward to capture. On its first move, it may move two spaces forward without capturing so long as it isn't blocked. If this move takes it over a space an enemy %s could have captured it on if it had moved there, that %s may immediately capture it by en passant by moving to that space. On reaching the last rank, it must promote to any other piece except the King." 951 set Black_Pawn-Desc var White_Pawn-Desc 952 def White_Pawn remove var ep and < rankname #1 var bpr and < rankname var ep rankname #1 and == filename var ep filename #1 and checkleap #0 #1 1 1 and var ep or and checkride #0 #1 0 1 == rankname #0 var wpr or checkleap #0 #1 0 1 and empty #1 and != var movetype CHECK or and not empty #1 checkleap #0 #1 1 1 and any onboard where #1 0 1 == var movetype CHECK count var wprom and <= distance #0 #1 var fps and > rank #1 rank #0 953 def Black_Pawn remove var ep and > rankname #1 var wpr and > rankname var ep rankname #1 and == filename var ep filename #1 and checkleap #0 #1 1 1 and var ep or and checkride #0 #1 0 1 == rankname #0 var bpr or checkleap #0 #1 0 1 and empty #1 and != var movetype CHECK or and not empty #1 checkleap #0 #1 1 1 and any count var bprom onboard where #1 0 -1 == var movetype CHECK and <= distance #0 #1 var fps and < rank #1 rank #0 954 def White_Pawn-Range filter lambda (onboard #1) mergeall where #ori -1 1 where #ori 1 1 values lambda (where #ori 0 #1) range 1 var fps =ori 955 def Black_Pawn-Range filter lambda (onboard #1) mergeall where #ori -1 -1 where #ori 1 -1 values lambda (where #ori 0 neg #1) range 1 var fps =ori 956 def White_Pawn-Promote var wprom 957 def Black_Pawn-Promote var bprom 958 sub White_Pawn from to 959 my newpiece 960 my newmove 961 my prom 962 verify > rank #to rank #from 963 verify <= distance #to #from #fps 964 if capture 965 verify checkleap #from #to 1 1 966 set ep false 967 elseif checkleap #from #to 1 1 and #ep 968 verify == filename var ep filename #to 969 verify < rankname var ep rankname #to 970 verify < rankname #to var bpr 971 capture #ep 972 set ep false 973 elseif > distance #to #from 1 974 verify == rankname #from #wpr 975 verify checkride #from #to 0 1 976 set ep #to 977 else 978 verify checkleap #from #to 0 1 979 set ep false 980 endif 981 set prom fn White_Pawn-Promote #to 982 if onboard where #to 0 #pzs 983 if != space #to $moved 984 set name alias const alias $moved 985 die "You may not promote a" #name "until it reaches the promotion zone." 986 endif 987 elseif onboard where #to 0 1 988 if == White_Pawn const alias space #to and count var prom 989 if not $answered and == mln $maxmln and not strstr thismove chr 59 990 if not match alias space #to var prom 991 push prom space #to 992 endif 993 askpromote #prom 994 endif 995 elseif not match space #to var prom and != White_Pawn const alias space #to 996 set name alias const alias $moved 997 set newname alias const alias space #to 998 set msg list "You may not promote your" #name "to a" join #newname ".
" 999 set msg str_replace "_" " " var msg 1000 die #msg 1001 endif 1002 elseif count var prom 1003 if == White_Pawn const alias space #to 1004 if == count var prom 1 1005 set newpiece alias list var prom 1006 set pieceid realname #newpiece 1007 set newmove join #newpiece "-dest" 1008 add #pieceid $dest 1009 appendmove #newmove 1010 else 1011 askpromote #prom 1012 endif 1013 elseif not match alias space #to var prom 1014 set name alias const alias $moved 1015 set newname alias const alias space #to 1016 set msg list "You may not promote your" #name "to a" join #newname ".
" 1017 set msg str_replace "_" " " var msg 1018 die #msg 1019 endif 1020 else 1021 set name alias const alias $moved 1022 set msg list "You may not advance your" #name "to the last rank, because there is nothing you may promote it to." 1023 set msg str_replace "_" " " var msg 1024 die #msg 1025 endif 1026 set nopvc 0 1027 return true 1028 endsub 1029 sub Black_Pawn from to 1030 my newpiece, pieceid 1031 my newmove 1032 my prom 1033 verify < rank #to rank #from 1034 verify <= distance #to #from #fps 1035 if capture 1036 verify checkleap #from #to 1 1 1037 set ep false 1038 elseif checkleap #from #to 1 1 and #ep 1039 verify == filename var ep filename #to 1040 verify > rankname var ep rankname #to 1041 verify > rankname #to var wpr 1042 capture #ep 1043 set ep false 1044 elseif > distance #to #from 1 1045 verify == rankname #from #bpr 1046 verify checkride #from #to 0 1 1047 set ep #to 1048 else 1049 verify checkleap #from #to 0 1 1050 set ep false 1051 endif 1052 set prom fn Black_Pawn-Promote #to 1053 if onboard where #to 0 neg #pzs 1054 if != space #to $moved 1055 set name alias const alias $moved 1056 die "You may not promote a" #name "until it reaches the promotion zone." 1057 endif 1058 elseif onboard where #to 0 -1 1059 if == Black_Pawn const alias space #to and count var prom 1060 if not $answered and == mln $maxmln and not strstr thismove chr 59 1061 push prom space #to 1062 askpromote #prom 1063 endif 1064 elseif not match space #to var prom and != Black_Pawn const alias space #to 1065 set name alias const alias $moved 1066 set newname alias const alias space #to 1067 set msg list "You may not promote your" #name "to a" join #newname ".
" 1068 set msg str_replace "_" " " var msg 1069 die #msg 1070 endif 1071 elseif count var prom 1072 if == Black_Pawn const alias space #to 1073 if == count var prom 1 1074 set newpiece alias list var prom 1075 set newmove join #newpiece "-dest" 1076 set pieceid realname var newpiece 1077 add #pieceid $dest 1078 appendmove #newmove 1079 else 1080 askpromote #prom 1081 endif 1082 elseif not match alias space #to var prom 1083 set name alias const alias $moved 1084 set newname alias const alias space #to 1085 set msg list "You may not promote your" #name "to a" join #newname ".
" 1086 set msg str_replace "_" " " var msg 1087 die #msg 1088 endif 1089 else 1090 set name alias const alias $moved 1091 set msg list "You may not advance your" #name "to the last rank, because there is nothing you may promote it to." 1092 set msg str_replace "_" " " var msg 1093 die #msg 1094 endif 1095 set nopvc 0 1096 return true 1097 endsub 1098 set White_Quick_Pawn-Desc "The %s may move one or two spaces straight forward without capturing, or it may move one space diagonally forward to capture. If its two-space move takes it over a space an enemy %s could have captured it on if it had moved there, that %s may immediately capture it by en passant by moving to that space. On reaching the last rank, it must promote to any other piece except the King." 1099 set Black_Quick_Pawn-Desc var White_Quick_Pawn-Desc 1100 def White_Quick_Pawn remove var ep and < rankname #1 rankname var epf and < rankname var ep rankname #1 and == filename var ep filename #1 and checkleap #0 #1 1 1 and var ep or checkride #0 #1 0 1 and empty #1 and != var movetype CHECK or and or not empty #1 == var movetype CHECK checkleap #0 #1 1 1 and any onboard where #1 0 1 == var movetype CHECK count var wprom and <= distance #0 #1 var fps and > rank #1 rank #0 1101 def Black_Quick_Pawn remove var ep and > rankname #1 rankname var epf and > rankname var ep rankname #1 and == filename var ep filename #1 and checkleap #0 #1 1 1 and var ep or checkride #0 #1 0 1 and empty #1 and != var movetype CHECK or and or not empty #1 == var movetype CHECK checkleap #0 #1 1 1 and any count var bprom onboard where #1 0 -1 == var movetype CHECK and <= distance #0 #1 var fps and < rank #1 rank #0 1102 def White_Quick_Pawn-Range filter lambda (onboard #1) mergeall where #ori -1 1 where #ori 1 1 values lambda (where #ori 0 #1) range 1 var fps =ori 1103 def Black_Quick_Pawn-Range filter lambda (onboard #1) mergeall where #ori -1 -1 where #ori 1 -1 values lambda (where #ori 0 neg #1) range 1 var fps =ori 1104 def White_Quick_Pawn-Promote var wprom 1105 def Black_Quick_Pawn-Promote var bprom 1106 sub White_Quick_Pawn from to 1107 my newpiece 1108 my newmove 1109 my prom 1110 verify > rank #to rank #from 1111 verify <= distance #to #from #fps 1112 if capture 1113 verify checkleap #from #to 1 1 1114 set epf false 1115 set ep false 1116 elseif checkleap #from #to 1 1 and #ep 1117 verify == filename var ep filename #to 1118 verify < rankname var ep rankname #to 1119 verify < rankname #to rankname var epf 1120 capture #ep 1121 set epf false 1122 set ep false 1123 elseif > distance #to #from 1 1124 verify checkride #from #to 0 1 1125 set epf #from 1126 set ep #to 1127 else 1128 verify checkleap #from #to 0 1 1129 set epf false 1130 set ep false 1131 endif 1132 set prom fn White_Quick_Pawn-Promote #to 1133 if onboard where #to 0 #pzs 1134 if != space #to $moved 1135 set name alias const alias $moved 1136 die "You may not promote a" #name "from" $moved "to" {space #to} "until it reaches the promotion zone." 1137 endif 1138 elseif onboard where #to 0 1 1139 if == White_Quick_Pawn const alias space #to and count var prom 1140 if not $answered and == mln $maxmln and not strstr thismove chr 59 1141 if not match alias space #to var prom 1142 push prom space #to 1143 endif 1144 askpromote #prom 1145 endif 1146 elseif not match space #to var prom and != White_Quick_Pawn const alias space #to 1147 set name alias const alias $moved 1148 set newname alias const alias space #to 1149 set msg list "You may not promote your" #name "to a" join #newname ".
" 1150 set msg str_replace "_" " " var msg 1151 die #msg 1152 endif 1153 elseif count var prom 1154 if == White_Quick_Pawn const alias space #to 1155 if == count var prom 1 1156 set newpiece alias list var prom 1157 set pieceid realname #newpiece 1158 set newmove join #newpiece "-dest" 1159 add #pieceid $dest 1160 appendmove #newmove 1161 else 1162 askpromote #prom 1163 endif 1164 elseif not match alias space #to var prom 1165 set name alias const alias $moved 1166 set newname alias const alias space #to 1167 set msg list "You may not promote your" #name "to a" join #newname ".
" 1168 set msg str_replace "_" " " var msg 1169 die #msg 1170 endif 1171 else 1172 set name alias const alias $moved 1173 set msg list "You may not advance your" #name "to the last rank, because there is nothing you may promote it to." 1174 set msg str_replace "_" " " var msg 1175 die #msg 1176 endif 1177 set nopvc 0 1178 return true 1179 endsub 1180 sub Black_Quick_Pawn from to 1181 my newpiece, pieceid 1182 my newmove 1183 my prom 1184 verify < rank #to rank #from 1185 verify <= distance #to #from #fps 1186 if capture 1187 verify checkleap #from #to 1 1 1188 set ep false 1189 set epf false 1190 elseif checkleap #from #to 1 1 and #ep 1191 verify == filename var ep filename #to 1192 verify > rankname var ep rankname #to 1193 verify > rankname #to rankname var epf 1194 capture #ep 1195 set ep false 1196 set epf false 1197 elseif > distance #to #from 1 1198 verify checkride #from #to 0 1 1199 set ep #to 1200 set epf #from 1201 else 1202 verify checkleap #from #to 0 1 1203 set ep false 1204 set epf false 1205 endif 1206 set prom fn Black_Quick_Pawn-Promote #to 1207 if onboard where #to 0 neg #pzs 1208 if != space #to $moved 1209 set name alias const alias $moved 1210 die "You may not promote a" #name "until it reaches the promotion zone." 1211 endif 1212 elseif onboard where #to 0 -1 1213 if == Black_Quick_Pawn const alias space #to and count var prom 1214 if not $answered and == mln $maxmln and not strstr thismove chr 59 1215 push prom space #to 1216 askpromote #prom 1217 endif 1218 elseif not match space #to var prom and != Black_Quick_Pawn const alias space #to 1219 set name alias const alias $moved 1220 set newname alias const alias space #to 1221 set msg list "You may not promote your" #name "to a" join #newname ".
" 1222 set msg str_replace "_" " " var msg 1223 die #msg 1224 endif 1225 elseif count var prom 1226 if == Black_Quick_Pawn const alias space #to 1227 if == count var prom 1 1228 set newpiece alias list var prom 1229 set newmove join #newpiece "-dest" 1230 set pieceid realname var newpiece 1231 add #pieceid $dest 1232 appendmove #newmove 1233 else 1234 askpromote #prom 1235 endif 1236 elseif not match alias space #to var prom 1237 set name alias const alias $moved 1238 set newname alias const alias space #to 1239 set msg list "You may not promote your" #name "to a" join #newname ".
" 1240 set msg str_replace "_" " " var msg 1241 die #msg 1242 endif 1243 else 1244 set name alias const alias $moved 1245 set msg list "You may not advance your" #name "to the last rank, because there is nothing you may promote it to." 1246 set msg str_replace "_" " " var msg 1247 die #msg 1248 endif 1249 set nopvc 0 1250 return true 1251 endsub 1252 def Queen fn Bishop #0 #1 or fn Rook #0 #1 1253 def Queen-Range merge rays #0 1 0 rays #0 1 1 1254 set Queen-Desc "The %s may move as a Rook or a Bishop." 1255 def Rhino windingride #0 #1 1 0 1 1 or windingride #0 #1 0 1 1 1 1256 def Rhino-Range merge eval (windingrays #0 1 0 1 1) windingrays #0 0 1 1 1 1257 set Rhino-Desc "The %s moves along a winding path that alternates between the same one-space orthogonal move and the same one-space diagonal move both in the same general direction." 1258 def Rook checkride #0 #1 1 0 1259 def Rook-Range rays #0 1 0 1260 set Rook-Desc "The %s may move any number of spaces in any vertical or horizontal direction until it reaches an occupied space." 1261 def Short_Rook checkride #0 #1 1 0 and <= distance #0 #1 4 1262 def Short_Rook-Range merge merge leaps #0 1 0 leaps #0 2 0 merge leaps #0 3 0 leaps #0 4 0 1263 set "The %s may move up to four spaces along its rank or file as a Rook." 1264 def White_Shogi_Knight checkaleap #0 #1 1 2 or checkaleap #0 #1 -1 2 1265 def White_Shogi_Knight-Range array where #0 1 2 where #0 -1 2 1266 set White_Shogi_Knight-Desc "The %s may leap to either space that is two ranks ahead and one file to the side." 1267 def Black_Shogi_Knight checkaleap #0 #1 1 -2 or checkaleap #0 #1 -1 -2 1268 def Black_Shogi_Knight-Range array where #0 1 -2 where #0 -1 -2 1269 set Black_Shogi_Knight-Desc "The %s may leap to either space that is two ranks ahead and one file to the side." 1270 def White_Shogi_Pawn checkaleap #0 #1 0 1 1271 def White_Shogi_Pawn-Range array where #0 0 1 1272 set White_Shogi_Pawn-Desc "The %s map move one space forward in the same file." 1273 def Black_Shogi_Pawn checkaleap #0 #1 0 -1 1274 def Black_Shogi_Pawn-Range array where #0 0 -1 1275 set Black_Shogi_Pawn-Desc "The %s map move one space forward in the same file." 1276 def White_Silver_General checkaleap #0 #1 0 1 or checkleap #0 #1 1 1 1277 def White_Silver_General-Range mergeall leaps #0 1 1 where #0 0 1 1278 set White_Silver_General-Desc "The %s may move one space in any diagonal direction or one space vertically foward." 1279 def Black_Silver_General checkaleap #0 #1 0 -1 or checkleap #0 #1 1 1 1280 def Black_Silver_General-Range mergeall leaps #0 1 1 where #0 0 -1 1281 set Black_Silver_General-Desc "The %s may move one space in any diagonal direction or one space vertically foward." 1282 def Squirrel fn Elephant #0 #1 or fn Dabbabah #0 #1 or fn Knight #0 #1 1283 def Squirrel-Range mergeall leaps #0 2 2 leaps #0 2 0 leaps #0 1 2 1284 set Squirrel-Desc "The %s may leap any non-adjacent space that is no more than two spaces away." 1285 def Spider fn Dabbabah #0 #1 or fn Elephant #0 #1 1286 def Spider-Range merge leaps #0 2 2 leaps #0 0 2 1287 set Spider-Desc "The %s may leap to any space that is two spaces away orthogonally or diagonally." 1288 def Spider-rider fn Dabbabahrider #0 #1 or fn Elephantrider #0 #1 1289 def Spider-rider-Range merge rays #0 2 2 rays #0 0 2 1290 set Spider-rider-Desc "The %s may make any number of two-space leaps in a single orthogonal or diagonal direction. While each leap may take it over an occupied space, each leap but the last must be to an empty space." 1291 def Squire checktwostep #0 #1 0 1 1 1 or checktwostep #0 #1 1 1 0 1 1292 def Squire-Range leaps #0 1 2 1293 set Squire-Desc "The %s may move one space orthogonally, followed by one more space in an outward diagonal direction, or it may move one space diagonally, followed by one more space in an outward orthogonal direction. It must complete both parts of its move, and it may not pass over an occupied space. It can reach the same spaces as a Knight except that it can be blocked on the first step of its two-space move." 1294 def Unicorn fn Nightrider #0 #1 or fn Bishop #0 #1 1295 def Unicorn-Range merge rays #0 1 2 rays #0 1 1 1296 set Unicorn-Desc "The %s may make consecutive Knight moves in the same direction, as a Nightrider does, or it may move diagonally as a Bishop." 1297 def Vao cond cond empty #0 capture (not empty #1) (checkhop #0 #1 1 1) (checkride #0 #1 1 1) and #1 1298 def Vao-Range rays #0 1 1 1299 set Vao-Desc "The %s may move diagonally as a Bishop, but it must hop over exactly one intervening piece when it captures." 1300 def Wazir checkleap #0 #1 1 0 1301 def Wazir-Range leaps #0 1 0 1302 set Wazir-Desc "The %s may move one space horizontally or vertically." 1303 def Wizard fn Ferz #0 #1 or fn Camel #0 #1 1304 def Wizard-Range merge leaps #0 1 1 leaps #0 1 3 1305 set Wizard-Desc "The %s may move one space diagonally, or it may leap to a space three ranks and one file or three files and one rank away, as a Camel does." 1306 def Woody_Rook checkleap #0 #1 0 2 or checkleap #0 #1 0 1 1307 def Woody_Rook-Range merge leaps #0 0 1 leaps #0 0 2 1308 set Woody_Rook-Desc "The %s may leap one or two spaces orthogonally. It may pass over another piece when moving two spaces." 1309 def Zebra checkleap #0 #1 2 3 1310 def Zebra-Range leaps #0 2 3 1311 set Zebra-Desc "The %s may leap to any space that is 2 ranks and 3 files or 2 files and 3 ranks away." 1312 def Elephant_Ferz fn Ferz #0 #1 or fn Elephant #0 #1 1313 def Elephant_Ferz-Range merge leaps #0 2 2 leaps #0 1 1 1314 set Elephant_Ferz-Desc "The %s may leap one or two spaces diagonally. It may pass over another piece when moving two spaces." 1315 def Elephant_Wazir fn Wazir #0 #1 or fn Elephant #0 #1 1316 def Elephant_Wazir-Range merge leaps #0 2 2 leaps #0 1 0 1317 set Elephant_Wazir-Desc "The %s may move one space orthogonally, as a Wazir, or leap two spaces diagonally, as an Elephant." 1318 def Kylin fn Ferz #0 #1 or fn Dabbabah #0 #1 1319 def Kylin-Range mergeall leaps #0 1 1 leaps #0 2 0 1320 set Kylin-Desc "The %s may move one space diagonally, or it may leap 2 spaces orthogonally, passing over any pieces in the way." 1321 def Half_Duck fn Ferz #0 #1 or fn Dabbabah #0 #1 or checkleap #0 #1 3 0 1322 def Half_Duck-Range mergeall leaps #0 1 1 leaps #0 2 0 leaps #0 3 0 1323 set Half_Duck-Desc "The %s may move one space diagonally, or it may leap 2 or 3 spaces orthogonally, passing over any pieces in the way." 1324 def Knight_Wazir fn Knight #0 #1 or fn Wazir #0 #1 1325 def Knight_Wazir-Range merge leaps #0 1 2 leaps #0 1 0 1326 set Knight_Wazir-Desc "The %s may move one space orthogonally, as a Wazir, or it may leap as a Knight to any space one file and two ranks or two files and one rank away." 1327 def Frog fn Ferz #0 #1 or checkleap #0 #1 3 0 1328 def Frog-Range merge leaps #0 1 1 leaps #0 3 0 1329 set Frog-Desc "The %s may move one space diagonally or directly leap 3 spaces orthogonally." 1330 def Buffalo fn Knight #0 #1 or fn Camel #0 #1 or fn Zebra #0 #1 1331 def Buffalo-Range mergeall leaps #0 1 2 leaps #0 1 3 leaps #0 2 3 1332 set Buffalo-Desc "The %s Buffalo may leap (1, 2) as a Knight, (1, 3) as a Camel, or (2, 3) as a Zebra." 1333 def @ false 1334 sub attacked start finish 1335 my from piece actual 1336 local movetype 1337 set movetype MOVE 1338 if empty #start 1339 set actual true 1340 move #finish #start 1341 add $old #finish 1342 endif 1343 if isupper space #start 1344 def enemies onlylower 1345 else 1346 def enemies onlyupper 1347 endif 1348 for (from piece) fn enemies 1349 if fn const alias #piece #from #to 1350 if #actual 1351 move #start #finish 1352 endif 1353 return #from 1354 endif 1355 next 1356 if #actual 1357 move #start #finish 1358 endif 1359 return false 1360 endsub 1361 sub fission-attacked start finish 1362 my from piece p1 p2 1363 local movetype 1364 set p1 space #start 1365 set p2 space #finish 1366 set movetype CHECK 1367 if isupper #p1 1368 def enemies onlylower 1369 else 1370 def enemies onlyupper 1371 endif 1372 empty #finish 1373 for (from piece) fn enemies 1374 if fn const alias #piece #from #start 1375 add #p2 #finish 1376 return #from 1377 endif 1378 next 1379 add #p2 #finish 1380 return false 1381 endsub 1382 sub checked king 1383 my from piece 1384 local movetype 1385 set movetype CHECK 1386 if isupper cond empty var king $moved space var king 1387 def enemies onlylower 1388 else 1389 def enemies onlyupper 1390 endif 1391 for (from piece) fn enemies 1392 if fn const alias #piece #from var king and isfunc const alias #piece 1393 return #from 1394 endif 1395 next 1396 return false 1397 endsub 1398 def checked anytrue lambda (fn const alias #0 var key var king) cond isupper space var king (onlylower) (onlyupper) =movetype CHECK =king 1399 def threatened anytrue lambda (fn const alias space #0 #0 var king) elem var king threats =movetype CHECK =king 1400 sub uncheckedpath start finish 1401 my from to piece kingpos 1402 local movetype 1403 set movetype CHECK 1404 if empty #finish 1405 set kingpos #start 1406 else 1407 set kingpos #finish 1408 endif 1409 if isupper space #kingpos 1410 def enemies onlylower 1411 else 1412 def enemies onlyupper 1413 endif 1414 for to path #start #finish 1415 move #kingpos #to 1416 for (from piece) fn enemies 1417 if fn const alias #piece #from #to 1418 move #to #kingpos 1419 return false 1420 endif 1421 next 1422 move #to #kingpos 1423 next 1424 return true 1425 endif 1426 sub uncheckedknightleap start finish 1427 my from to piece kingpos kingpiece checkedpaths 1428 local movetype 1429 set movetype CHECK 1430 if empty #start 1431 set kingpos #finish 1432 else 1433 set kingpos #start 1434 endif 1435 if isupper space #kingpos 1436 def enemies onlylower 1437 else 1438 def enemies onlyupper 1439 endif 1440 set kingpiece space #kingpos 1441 set avenues merge intersection leaps #start 1 0 leaps #finish 1 1 intersection leaps #start 1 1 leaps #finish 1 0 1442 set checkdpaths 0 1443 for to #avenues 1444 if empty #to 1445 move #kingpos #to 1446 else 1447 empty #kingpos 1448 endif 1449 for (from piece) fn enemies 1450 if fn const alias #piece #from #to 1451 inc checkedpaths 1452 break 1453 endif 1454 next 1455 if == space #to #kingpiece 1456 move #to #kingpos 1457 else 1458 add #kingpiece #kingpos 1459 endif 1460 if == checkedpaths 0 1461 break 1462 endif 1463 next 1464 return < var checkedpaths 2 1465 endif 1466 sub castle from to 1467 local coord RPOS RDEST xdir 1468 if not flag #from 1469 die A King may not castle after it moves. 1470 endif 1471 if capture 1472 die A King may not castle to an occupied space. 1473 endif 1474 set xdir sign minus file #to file #from 1475 if not checkaride #from #to #xdir 0 1476 die A King may not castle across any occupied space. 1477 endif 1478 set coord #to 1479 do 1480 set coord where #coord #xdir 0 1481 if flag #coord 1482 break 1483 elseif not onboard #coord 1484 die No piece was found to castle with. 1485 elseif not empty #coord 1486 die The King cannot castle with the piece at #coord 1487 endif 1488 loop 1489 set RPOS #coord 1490 move #to #from 1491 if sub checked #from 1492 die A King may not castle out of check. 1493 endif 1494 store 1495 for coord path #from #to 1496 move #from #coord 1497 if sub checked #coord 1498 die A King may not castle through check. 1499 endif 1500 restore 1501 next 1502 move #from #to 1503 set RDEST where #to neg #xdir 0 1504 move #RPOS #RDEST 1505 return true 1506 endsub 1507 sub castlepos from to 1508 local coord RPOS RDEST xdir safe 1509 verify flag #from 1510 verify empty #to 1511 set xdir sign minus file #to file #from 1512 verify checkaride #from #to #xdir 0 1513 verify not sub checked #from 1514 set coord #to 1515 do 1516 set coord where #coord #xdir 0 1517 if flag #coord 1518 break 1519 endif 1520 verify onboard #coord 1521 verify empty #coord 1522 loop 1523 verify flag #coord 1524 set RPOS #coord 1525 store 1526 for coord path #from #to 1527 move #from #coord 1528 set safe not sub checked #coord 1529 restore 1530 verify #safe 1531 next 1532 move #from #to 1533 set RDEST where #to neg #xdir 0 1534 move #RPOS #RDEST 1535 set safe not sub checked #to 1536 restore 1537 return #safe 1538 endsub 1539 sub castle2 kingfrom kingto rookfrom rookto 1540 local coord xdir king rook 1541 if not flag #kingfrom 1542 die A King may not castle after it moves. 1543 endif 1544 if not flag #rookfrom 1545 die A King may not castle with a piece that has already moved. 1546 endif 1547 if not match @ $lastcaptured $prevcaptured 1548 die Castling to an occupied space is not allowed. 1549 endif 1550 if empty #kingto 1551 die There is nothing on #kingto. Did you move a piece there and then move it away? 1552 endif 1553 if empty #rookto 1554 die There is nothing on #rookto. Did you move a piece there and then move it away? 1555 endif 1556 set king space #kingto 1557 set rook space #rookto 1558 if == #king #rook 1559 die "Castling must be between different pieces. These two are both {#king}. What happened?" 1560 endif 1561 empty #kingto 1562 empty #rookto 1563 add #king #kingfrom 1564 add #rook #rookfrom 1565 set xdir sign minus file #kingto file #kingfrom 1566 if not checkaride #kingfrom #kingto #xdir 0 1567 die A King may not castle across any occupied space. 1568 endif 1569 if not checkaride #rookto #rookfrom #xdir 0 1570 die A Rook may not castle across an occupied space. 1571 endif 1572 if sub checked #kingfrom 1573 die A King may not castle out of check. 1574 endif 1575 store 1576 for coord path #kingfrom #kingto 1577 move #kingfrom #coord 1578 if sub checked #coord 1579 die A King may not castle through check. 1580 endif 1581 restore 1582 next 1583 empty #kingfrom 1584 empty #rookfrom 1585 add #king #kingto 1586 add #rook #rookto 1587 unsetflag #kingfrom #rookfrom 1588 if isupper space #kingto 1589 set Kpos #kingto 1590 else 1591 set kpos #kingto 1592 endif 1593 return true 1594 endsub 1595 sub castlepos2 kingfrom kingto rookfrom rookto 1596 echo "Calling castlepos2" #kingfrom #kingto #rookfrom #rookto 1597 local coord xdir safe 1598 verify flag #kingfrom and flag #rookfrom 1599 echo "Verified flags" 1600 verify empty #kingto or == #kingto #rookfrom 1601 verify empty #rookto or == #rookto #kingfrom 1602 echo "Verified empty destinations" 1603 set xdir sign minus file #kingto file #kingfrom 1604 echo "xdir is {#xdir}" 1605 verify checkride #kingfrom #kingto #xdir 0 1606 echo "Verified checkride {#kingfrom} {#kingto} {#xdir} 0" 1607 verify checkride #rookto #rookfrom #xdir 0 1608 echo "Verified checkride {#kingto} {#kingfrom} {#xdir} 0" 1609 verify not sub checked #kingfrom 1610 echo "Verified not checked" 1611 store 1612 for coord path #kingfrom #kingto 1613 move #kingfrom #coord 1614 set safe not sub checked #coord 1615 restore 1616 verify #safe 1617 next 1618 move #kingfrom #kingto 1619 move #rookfrom #rookto 1620 set safe not sub checked #kingto 1621 restore 1622 return #safe 1623 endsub 1624 sub stalemated kingpos 1625 store 1626 local cspaces friend friends from king piece to movetype np prom promfn 1627 set movetype MOVE 1628 set king alias space #kingpos 1629 if hasupper #king 1630 set friends lambda (onlyupper) 1631 set free lambda (haslower #0 or not hasupper #0) 1632 set pzone lambda (not onboard where #0 0 var pzs) 1633 set cspaces var wcastle 1634 set prom var wprom 1635 else 1636 set friends lambda (onlylower) 1637 set free lambda (hasupper #0 or not haslower #0) 1638 set pzone lambda (not onboard where #0 0 neg var pzs) 1639 set cspaces var bcastle 1640 set prom var bprom 1641 endif 1642 store 1643 for (from piece) fn #friends 1644 set af alias #from 1645 for to fn join const alias #piece "-Range" #from 1646 set at alias #to 1647 if fn const alias #piece #from #to and fn #free alias space #to and onboard #to 1648 set ap alias #piece 1649 move #from #to 1650 if not sub checked cond == #from #kingpos #to #kingpos 1651 set promfn join const alias #piece "-Promote" 1652 if fn #pzone #to and match #piece #promotable 1653 if > count var prom 0 1654 for np var prom 1655 setlegal "{#ap} {#af}-{#at}; {#np}-{#at}" 1656 next 1657 endif 1658 elseif fn #pzone #to and isfunc var promfn 1659 set prom fn var promfn #to 1660 if > count var prom 0 1661 for np var prom 1662 setlegal "{#ap} {#af}-{#at}; {#np}-{#at}" 1663 next 1664 endif 1665 elseif fn #pzone #to and match #piece #promotable 1666 if > count var prom 0 1667 for np var prom 1668 setlegal "{#ap} {#af}-{#at}; {#np}-{#at}" 1669 next 1670 endif 1671 else 1672 setlegal "{#ap} {#af}-{#at}" 1673 endif 1674 endif 1675 endif 1676 restore 1677 next 1678 next 1679 if > count var cspaces 0 1680 for to var cspaces 1681 if sub castlepos #kingpos #to 1682 setlegal "{#king} {#kingpos}-{#to}" 1683 endif 1684 next 1685 endif 1686 setsystem autorules sub describe_rules 1687 return cond count system legalmoves false true 1688 endsub 1689 sub stalemated-quick kingpos 1690 store 1691 local checked checkpos cspaces enemies friend friends from in king piece threats to movetype np prom promfn 1692 set movetype MOVE 1693 set king alias space #kingpos 1694 if hasupper #king 1695 set friends lambda (onlyupper) 1696 set enemies lambda (onlylower) 1697 set free lambda (haslower #0 or not hasupper #0) 1698 set pzone lambda (not onboard where #0 0 var pzs) 1699 set cspaces var wcastle 1700 set prom var wprom 1701 else 1702 set friends lambda (onlylower) 1703 set enemies lambda (onlyupper) 1704 set free lambda (hasupper #0 or not haslower #0) 1705 set pzone lambda (not onboard where #0 0 neg var pzs) 1706 set cspaces var bcastle 1707 set prom var bprom 1708 endif 1709 set krange merge fn join const alias space #kingpos "-Range" #kingpos #kingpos 1710 set threats () 1711 for to #krange 1712 set threats.{#to} () 1713 next 1714 for (from piece) fn #enemies 1715 set in intersection var krange fn join const alias var piece "-Range" var from 1716 for to #in 1717 push threats.{#to} #from 1718 next 1719 next 1720 store 1721 for (from piece) fn #friends 1722 set af alias #from 1723 for to fn join const alias #piece "-Range" #from 1724 set at alias #to 1725 if fn const alias #piece #from #to and fn #free alias space #to and onboard #to 1726 set ap alias #piece 1727 set checkpos cond == #from #kingpos #to #kingpos 1728 set checked false 1729 if count elem var checkpos threats 1730 move #from #to 1731 set checked fn threatened #checkpos 1732 restore 1733 endif 1734 if not #checked 1735 set promfn join const alias #piece "-Promote" 1736 if fn #pzone #to and match #piece #promotable 1737 if > count var prom 0 1738 for np var prom 1739 setlegal "{#ap} {#af}-{#at}; {#np}-{#at}" 1740 next 1741 endif 1742 elseif fn #pzone #to and isfunc var promfn 1743 set prom fn var promfn #to 1744 if > count var prom 0 1745 for np var prom 1746 setlegal "{#ap} {#af}-{#at}; {#np}-{#at}" 1747 next 1748 endif 1749 elseif fn #pzone #to and match #piece #promotable 1750 if > count var prom 0 1751 for np var prom 1752 setlegal "{#ap} {#af}-{#at}; {#np}-{#at}" 1753 next 1754 endif 1755 else 1756 setlegal "{#ap} {#af}-{#at}" 1757 endif 1758 endif 1759 endif 1760 restore 1761 next 1762 next 1763 if > count var cspaces 0 1764 for to var cspaces 1765 if sub castlepos #kingpos #to 1766 setlegal "{#king} {#kingpos}-{#to}" 1767 endif 1768 next 1769 endif 1770 setsystem autorules sub describe_rules 1771 return cond count system legalmoves false true 1772 endsub 1773 sub stalemated2 kingpos 1774 store 1775 local cspaces friend friends from piece to movetype 1776 set movetype MOVE 1777 if isupper space #kingpos 1778 set friends (onlyupper) 1779 set friend (isupper #0) 1780 set cspaces var wcastle 1781 else 1782 set friends (onlylower) 1783 set friend (islower #0) 1784 set cspaces var bcastle 1785 endif 1786 set royal space var kingpos 1787 store 1788 for (from piece) fn #friends 1789 for to fn join const alias #piece "-Range" #from 1790 if fn const alias #piece #from #to and not fn #friend space #to and onboard #to 1791 move #from #to 1792 if not sub checked cond == #from #kingpos #to #kingpos 1793 set ap alias #piece 1794 setlegal "{#ap} {#from}-{#to}" 1795 endif 1796 endif 1797 restore 1798 next 1799 next 1800 if > count var cspaces 0 and flag #kingpos 1801 for mvs var cspaces 1802 if sub castlepos2 #mvs.0 #mvs.1 #mvs.2 #mvs.3 and == #kingpos #mvs.0 1803 set pk alias space #mvs.0 1804 set pr alias space #mvs.2 1805 setlegal "{#pk} {#mvs.0}-{#mvs.1}; {#pr} {#mvs.2}-{#mvs.3}" 1806 endif 1807 next 1808 endif 1809 setsystem autorules sub describe_rules 1810 return cond count system legalmoves false true 1811 endsub 1812 sub fusion-stalemated kingpos 1813 store 1814 local cspaces friend friends from piece to movetype mv ss 1815 set movetype MOVE 1816 set ss join chr 47 chr 47 1817 if isupper space #kingpos 1818 set friends (onlyupper) 1819 set friend (isupper #0) 1820 set cspaces var wcastle 1821 else 1822 set friends (onlylower) 1823 set friend (islower #0) 1824 set cspaces var bcastle 1825 endif 1826 set royal space var kingpos 1827 store 1828 set kp #kingpos 1829 for (from piece) fn #friends 1830 set ap alias #piece 1831 for to fn join const #ap "-Range" #from 1832 if != space #to #piece and match toupper alias space #to K R B N and match toupper alias #piece R B N or not fn #friend space #to and fn const alias #piece #from #to and onboard #to 1833 move #from #to 1834 if match #ap K KR KB KN k kr kb kn 1835 set kp #to 1836 endif 1837 if not sub checked #kp 1838 setlegal "{#ap} {#from}-{#to}" 1839 endif 1840 restore 1841 set kp #kingpos 1842 endif 1843 if not sub checked #from and empty #to and == strlen alias #piece 2 1844 set compound alias #piece 1845 set simple1 leftstr #compound 1 1846 set simple2 rightstr #compound 1 1847 if != not fn #friend space #to and fn const alias #simple1 #from #to 1848 add #simple1 #to 1849 add #simple2 #from 1850 if match #simple1 K k 1851 set kp #to 1852 endif 1853 if not sub checked #kp 1854 setlegal "{#simple1} {#from}-{#to}; {#ss} {#simple2}-{#from}" 1855 endif 1856 restore 1857 set kp #kingpos 1858 endif 1859 if != not fn #friend space #to and fn const alias #simple2 #from #to 1860 add #simple2 #to 1861 add #simple1 #from 1862 if match #simple1 K k 1863 set kp #from 1864 endif 1865 if not sub checked #kp 1866 setlegal "{#simple2} {#from}-{#to}; {#ss} {#simple1}-{#from}" 1867 endif 1868 restore 1869 set kp #kingpos 1870 endif 1871 endif 1872 next 1873 next 1874 if > count var cspaces 0 1875 for to var cspaces 1876 if sub castlepos #kingpos #to 1877 setlegal (#kingpos #to) 1878 endif 1879 next 1880 endif 1881 setsystem autorules sub describe_rules 1882 return cond count system legalmoves false true 1883 endsub 1884 sub describe_rules 1885 my c piecenames notation values val id ref rules desc name codename rangefn 1886 set c.0 join filename 0 rankname 0 1887 set c.1 join filename >> lastfile 1 rankname 1 1888 set c.2 join filename inc >> lastfile 1 rankname 1 1889 set c.3 join filename >> lastfile 1 rankname inc >> lastrank 1 1890 set c.4 join filename inc >> lastfile 1 rankname >> lastrank 1 1891 set c.5 join filename >> lastfile 1 rankname dec lastrank 1892 set c.6 join filename inc >> lastfile 1 rankname dec lastrank 1893 set c.7 join filename lastfile rankname lastrank 1894 foreach p keys $pieces 1895 if isconst alias #p 1896 set codename const alias #p 1897 set name alias #codename 1898 set notation.{#name} alias #p 1899 if match #codename const alias space #kpos const alias space #Kpos 1900 set values.{#name} * 8 count spaces 1901 else 1902 set rangefn join #codename "-Range" 1903 set values.{#name} sum lambda (count fn #rangefn #0) #c 1904 endif 1905 endif 1906 next 1907 set values reverse asort #values 1908 set rules "" 1909 foreach (name val) #values 1910 set codename realname #name 1911 if == null var #codename 1912 set codename #name 1913 endif 1914 set ref join #codename "-Desc" 1915 set desc str_replace "%s" #name var #ref 1916 set desc str_replace "_" " " #desc 1917 set id realname #notation.{#name} 1918 set rules join #rules "" 1921 return #rules 1922 endsub 1923 sub findmates side 1924 local enemyking king mates moves mv 1925 if match #side 1 white White first 1926 set king #Kpos 1927 set enemyking #kpos 1928 else 1929 set king #kpos 1930 set enemyking #Kpos 1931 endif 1932 set mates () 1933 ban none 1934 setsystem maxmove 0 1935 store main 1936 setsystem legalmoves () 1937 if not sub stalemated #king 1938 set lglmvs $legalmoves 1939 foreach move #lglmvs 1940 set moves explode chr 59 #move 1941 foreach mv #moves 1942 set mv trim #mv 1943 eval "MOVE: {#mv}" 1944 next 1945 if sub checked #enemyking 1946 setsystem legalmoves () 1947 if sub stalemated #enemyking 1948 push mates #move 1949 endif 1950 endif 1951 restore main 1952 next 1953 endif 1954 setsystem legalmoves #mates 1955 endsub 1956 endlib[pc {#id} {#name}]{#desc}[/pc]" 1919 next 1920 set rules join #rules "functions
Array ( [Aanca] => Array ( [0] => fn [1] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => and [6] => empty [7] => #0 ) [2] => where [3] => #0 [4] => 0 [5] => sign [6] => - [7] => rank [8] => #1 [9] => rank [10] => #0 [11] => #1 [12] => or [13] => fn [14] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => and [6] => empty [7] => #0 ) [15] => where [16] => #0 [17] => sign [18] => - [19] => file [20] => #1 [21] => file [22] => #0 [23] => 0 [24] => #1 [25] => or [26] => checkleap [27] => #0 [28] => #1 [29] => 1 [30] => 0 ) [Aanca-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 1 [4] => 0 [5] => rays [6] => where [7] => #0 [8] => 0 [9] => 1 [10] => 1 [11] => 1 [12] => rays [13] => where [14] => #0 [15] => 0 [16] => -1 [17] => 1 [18] => 1 [19] => rays [20] => where [21] => #0 [22] => 1 [23] => 0 [24] => 1 [25] => 1 [26] => rays [27] => where [28] => #0 [29] => -1 [30] => 0 [31] => 1 [32] => 1 ) [Amazon] => Array ( [0] => fn [1] => Bishop [2] => #0 [3] => #1 [4] => or [5] => fn [6] => Rook [7] => #0 [8] => #1 [9] => or [10] => fn [11] => Knight [12] => #0 [13] => #1 ) [Amazon-Range] => Array ( [0] => merge [1] => leaps [2] => # [3] => 1 [4] => 2 [5] => merge [6] => rays [7] => #0 [8] => 1 [9] => 0 [10] => rays [11] => #0 [12] => 1 [13] => 1 ) [Bede] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 0 [10] => 2 ) [Bede-Range] => Array ( [0] => merge [1] => rays [2] => #0 [3] => 1 [4] => 1 [5] => leaps [6] => #0 [7] => 0 [8] => 2 ) [White_Berolina_Pawn] => Array ( [0] => remove [1] => var [2] => epc [3] => and [4] => checkleap [5] => #0 [6] => #1 [7] => 1 [8] => 0 [9] => and [10] => == [11] => #1 [12] => var [13] => epp [14] => or [15] => and [16] => checkride [17] => #0 [18] => #1 [19] => 1 [20] => 1 [21] => == [22] => rankname [23] => #0 [24] => var [25] => wpr [26] => or [27] => checkleap [28] => #0 [29] => #1 [30] => 1 [31] => 1 [32] => and [33] => empty [34] => #1 [35] => or [36] => and [37] => islower [38] => space [39] => #1 [40] => checkleap [41] => #0 [42] => #1 [43] => 1 [44] => 0 [45] => and [46] => <= [47] => distance [48] => #0 [49] => #1 [50] => var [51] => fps [52] => and [53] => > [54] => rank [55] => #1 [56] => rank [57] => #0 ) [Black_Berolina_Pawn] => Array ( [0] => remove [1] => var [2] => epc [3] => and [4] => checkleap [5] => #0 [6] => #1 [7] => 1 [8] => 0 [9] => and [10] => == [11] => #1 [12] => var [13] => epp [14] => or [15] => and [16] => checkride [17] => #0 [18] => #1 [19] => 1 [20] => 1 [21] => == [22] => rankname [23] => #0 [24] => var [25] => bpr [26] => or [27] => checkleap [28] => #0 [29] => #1 [30] => 1 [31] => 1 [32] => and [33] => empty [34] => #1 [35] => or [36] => and [37] => isupper [38] => space [39] => #1 [40] => checkleap [41] => #0 [42] => #1 [43] => 1 [44] => 0 [45] => and [46] => <= [47] => distance [48] => #0 [49] => #1 [50] => var [51] => fps [52] => and [53] => < [54] => rank [55] => #1 [56] => rank [57] => #0 ) [White_Berolina_Pawn-Range] => Array ( [0] => filter [1] => lambda [2] => Array ( [0] => onboard [1] => #1 ) [3] => mergeall [4] => where [5] => #ori [6] => 0 [7] => 1 [8] => values [9] => lambda [10] => Array ( [0] => where [1] => #ori [2] => neg [3] => #1 [4] => #1 ) [11] => range [12] => 1 [13] => var [14] => fps [15] => values [16] => lambda [17] => Array ( [0] => where [1] => #ori [2] => #1 [3] => #1 ) [18] => range [19] => 1 [20] => var [21] => fps [22] => =ori ) [Black_Berolina_Pawn-Range] => Array ( [0] => filter [1] => lambda [2] => Array ( [0] => onboard [1] => #1 ) [3] => mergeall [4] => where [5] => #ori [6] => 0 [7] => -1 [8] => values [9] => lambda [10] => Array ( [0] => where [1] => #ori [2] => neg [3] => #1 [4] => neg [5] => #1 ) [11] => range [12] => 1 [13] => var [14] => fps [15] => values [16] => lambda [17] => Array ( [0] => where [1] => #ori [2] => #1 [3] => neg [4] => #1 ) [18] => range [19] => 1 [20] => var [21] => fps [22] => =ori ) [Bishop] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 1 ) [Bishop-Range] => Array ( [0] => rays [1] => #0 [2] => 1 [3] => 1 ) [Cannon] => Array ( [0] => cond [1] => cond [2] => empty [3] => #0 [4] => capture [5] => Array ( [0] => not [1] => empty [2] => #1 ) [6] => Array ( [0] => checkhop [1] => #0 [2] => #1 [3] => 0 [4] => 1 ) [7] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 0 [4] => 1 ) [8] => and [9] => #1 ) [Cannon-Range] => Array ( [0] => rays [1] => #0 [2] => 1 [3] => 0 ) [Camel] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 3 ) [Camel-Range] => Array ( [0] => leaps [1] => #0 [2] => 1 [3] => 3 ) [Camelrider] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 3 ) [Camelrider-Range] => Array ( [0] => rays [1] => #0 [2] => 1 [3] => 3 ) [Cardinal] => Array ( [0] => fn [1] => Bishop [2] => #0 [3] => #1 [4] => or [5] => fn [6] => Knight [7] => #0 [8] => #1 ) [Cardinal-Range] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 1 [4] => 2 [5] => rays [6] => #0 [7] => 1 [8] => 1 ) [Centaur] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 1 [10] => 0 [11] => or [12] => checkleap [13] => #0 [14] => #1 [15] => 1 [16] => 2 ) [Centaur-Range] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 1 [4] => 2 [5] => merge [6] => leaps [7] => #0 [8] => 1 [9] => 0 [10] => leaps [11] => #0 [12] => 1 [13] => 1 ) [Champion] => Array ( [0] => fn [1] => Elephant [2] => #0 [3] => #1 [4] => or [5] => fn [6] => Dabbabah [7] => #0 [8] => #1 [9] => or [10] => fn [11] => Wazir [12] => #0 [13] => #1 ) [Champion-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 2 [4] => 2 [5] => leaps [6] => #0 [7] => 2 [8] => 0 [9] => leaps [10] => #0 [11] => 1 [12] => 0 ) [White_Charging_Knight] => Array ( [0] => cond [1] => < [2] => rank [3] => #0 [4] => rank [5] => #1 [6] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 2 ) [7] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 1 [10] => 0 ) ) [White_Charging_Knight-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 1 [4] => 2 [5] => leaps [6] => #0 [7] => 1 [8] => 1 [9] => leaps [10] => #0 [11] => 1 [12] => 0 ) [Black_Charging_Knight] => Array ( [0] => cond [1] => > [2] => rank [3] => #0 [4] => rank [5] => #1 [6] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 2 ) [7] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 1 [10] => 0 ) ) [Black_Charging_Knight-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 1 [4] => 2 [5] => leaps [6] => #0 [7] => 1 [8] => 1 [9] => leaps [10] => #0 [11] => 1 [12] => 0 ) [White_Charging_Rook] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 0 [5] => and [6] => <= [7] => rank [8] => #0 [9] => rank [10] => #1 [11] => or [12] => checkaleap [13] => #0 [14] => #1 [15] => -1 [16] => -1 [17] => or [18] => checkaleap [19] => #0 [20] => #1 [21] => -1 [22] => 0 [23] => or [24] => checkaleap [25] => #0 [26] => #1 [27] => -1 [28] => 1 ) [White_Charging_Rook-Range] => Array ( [0] => mergeall [1] => ray [2] => #0 [3] => 0 [4] => -1 [5] => ray [6] => #0 [7] => 1 [8] => 0 [9] => ray [10] => #0 [11] => 0 [12] => 1 [13] => where [14] => #0 [15] => -1 [16] => 1 [17] => where [18] => #0 [19] => 1 [20] => 0 [21] => where [22] => #0 [23] => 1 [24] => 1 ) [Black_Charging_Rook] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 0 [5] => and [6] => >= [7] => rank [8] => #0 [9] => rank [10] => #1 [11] => or [12] => checkaleap [13] => #0 [14] => #1 [15] => -1 [16] => 1 [17] => or [18] => checkaleap [19] => #0 [20] => #1 [21] => 1 [22] => 0 [23] => or [24] => checkaleap [25] => #0 [26] => #1 [27] => 1 [28] => 1 ) [Black_Charging_Rook-Range] => Array ( [0] => mergeall [1] => ray [2] => #0 [3] => 0 [4] => -1 [5] => ray [6] => #0 [7] => -1 [8] => 0 [9] => ray [10] => #0 [11] => 0 [12] => 1 [13] => where [14] => #0 [15] => -1 [16] => 1 [17] => where [18] => #0 [19] => 1 [20] => 0 [21] => where [22] => #0 [23] => 1 [24] => 1 ) [Chinese_Elephant] => Array ( [0] => checkpath [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => 1 [6] => 1 ) [Chinese_Elephant-Range] => Array ( [0] => leaps [1] => #0 [2] => 2 [3] => 2 ) [White_Chinese_Elephant] => Array ( [0] => checkpath [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => 1 [6] => 1 [7] => and [8] => < [9] => rank [10] => #1 [11] => + [12] => 1 [13] => / [14] => lastrank [15] => 2 ) [White_Chinese_Elephant-Range] => Array ( [0] => leaps [1] => #0 [2] => 2 [3] => 2 ) [Black_Chinese_Elephant] => Array ( [0] => checkpath [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => 1 [6] => 1 [7] => and [8] => >= [9] => rank [10] => #1 [11] => + [12] => 1 [13] => / [14] => lastrank [15] => 2 ) [Black_Chinese_Elephant-Range] => Array ( [0] => leaps [1] => #0 [2] => 2 [3] => 2 ) [Chinese_General] => Array ( [0] => == [1] => distance [2] => #0 [3] => #1 [4] => 1 [5] => or [6] => == [7] => var [8] => movetype [9] => CHECK [10] => and [11] => checkride [12] => #0 [13] => #1 [14] => 1 [15] => 0 [16] => and [17] => flag [18] => #1 ) [Chinese_General-Range] => Array ( [0] => leaps [1] => #0 [2] => 1 [3] => 0 ) [Chinese_Guard] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => and [6] => flag [7] => #1 ) [Chinese_Guard-Range] => Array ( [0] => leaps [1] => #0 [2] => 1 [3] => 1 ) [White_Chinese_Pawn] => Array ( [0] => checkaleap [1] => #0 [2] => #1 [3] => -1 [4] => 0 [5] => or [6] => checkaleap [7] => #0 [8] => #1 [9] => 1 [10] => 0 [11] => and [12] => >= [13] => rank [14] => #0 [15] => + [16] => 1 [17] => / [18] => lastrank [19] => 2 [20] => or [21] => checkaleap [22] => #0 [23] => #1 [24] => 0 [25] => 1 ) [Black_Chinese_Pawn] => Array ( [0] => checkaleap [1] => #0 [2] => #1 [3] => -1 [4] => 0 [5] => or [6] => checkaleap [7] => #0 [8] => #1 [9] => 1 [10] => 0 [11] => and [12] => < [13] => rank [14] => #0 [15] => + [16] => 1 [17] => / [18] => lastrank [19] => 2 [20] => or [21] => checkaleap [22] => #0 [23] => #1 [24] => 0 [25] => -1 ) [White_Chinese_Pawn-Range] => Array ( [0] => leaps [1] => #0 [2] => 1 [3] => 0 ) [Black_Chinese_Pawn-Range] => Array ( [0] => leaps [1] => #0 [2] => 1 [3] => 0 ) [White_Colonel] => Array ( [0] => mergeall [1] => rays [2] => #0 [3] => 1 [4] => 0 [5] => leaps [6] => #0 [7] => 1 [8] => 2 [9] => leaps [10] => #0 [11] => 1 [12] => 1 ) [Black_Colonel] => Array ( [0] => mergeall [1] => rays [2] => #0 [3] => 1 [4] => 0 [5] => leaps [6] => #0 [7] => 1 [8] => 2 [9] => leaps [10] => #0 [11] => 1 [12] => 1 ) [Dabbabah] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 0 [4] => 2 ) [Dabbabah-Range] => Array ( [0] => leaps [1] => #0 [2] => 0 [3] => 2 ) [Dabbabahrider] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 0 [4] => 2 ) [Dabbabahrider-Range] => Array ( [0] => rays [1] => #0 [2] => 0 [3] => 2 ) [Dragon_Horse] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 1 [10] => 0 ) [Dragon_Horse-Range] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 1 [4] => 0 [5] => rays [6] => #0 [7] => 1 [8] => 1 ) [Dragon_King] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 0 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 1 [10] => 1 ) [Dragon_King-Range] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 1 [4] => 1 [5] => rays [6] => #0 [7] => 1 [8] => 0 ) [Elephant] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 2 [4] => 2 ) [Elephant-Range] => Array ( [0] => leaps [1] => #0 [2] => 2 [3] => 2 ) [Elephantrider] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 2 [4] => 2 ) [Elephantrider-Range] => Array ( [0] => rays [1] => #0 [2] => 2 [3] => 2 ) [Eques_Rex] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 1 [10] => 0 [11] => or [12] => checkleap [13] => #0 [14] => #1 [15] => 1 [16] => 2 ) [Eques_Rex-Range] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 1 [4] => 2 [5] => merge [6] => leaps [7] => #0 [8] => 1 [9] => 0 [10] => leaps [11] => #0 [12] => 1 [13] => 1 ) [Fad] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 2 [10] => 2 [11] => or [12] => checkleap [13] => #0 [14] => #1 [15] => 2 [16] => 0 ) [Fad-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 1 [4] => 1 [5] => leaps [6] => #0 [7] => 2 [8] => 2 [9] => leaps [10] => #0 [11] => 2 [12] => 0 ) [Ferz] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 1 ) [Ferz-Range] => Array ( [0] => leaps [1] => #0 [2] => 1 [3] => 1 ) [Fibnif] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 2 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 1 [10] => 1 [11] => and [12] => == [13] => 1 [14] => abs [15] => - [16] => file [17] => #0 [18] => file [19] => #1 ) [Fibnif-Range] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 1 [4] => 2 [5] => leaps [6] => #0 [7] => 1 [8] => 1 ) [Giraffe] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 4 ) [Giraffe-Range] => Array ( [0] => leaps [1] => #0 [2] => 1 [3] => 4 ) [White_Gold_General] => Array ( [0] => checkaleap [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => or [6] => checkaleap [7] => #0 [8] => #1 [9] => -1 [10] => 1 [11] => or [12] => checkleap [13] => #0 [14] => #1 [15] => 0 [16] => 1 ) [White_Gold_General-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 1 [4] => 0 [5] => where [6] => #0 [7] => 1 [8] => 1 [9] => where [10] => #0 [11] => -1 [12] => 1 ) [Black_Gold_General] => Array ( [0] => checkaleap [1] => #0 [2] => #1 [3] => 1 [4] => -1 [5] => or [6] => checkaleap [7] => #0 [8] => #1 [9] => -1 [10] => -1 [11] => or [12] => checkleap [13] => #0 [14] => #1 [15] => 0 [16] => 1 ) [Black_Gold_General-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 1 [4] => 0 [5] => where [6] => #0 [7] => 1 [8] => -1 [9] => where [10] => #0 [11] => -1 [12] => -1 ) [Grasshopper] => Array ( [0] => checkgrasshop [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => or [6] => checkgrasshop [7] => #0 [8] => #1 [9] => 1 [10] => 0 ) [Grasshopper-Range] => Array ( [0] => merge [1] => rays [2] => #0 [3] => 1 [4] => 0 [5] => rays [6] => #0 [7] => 1 [8] => 1 ) [Griffon] => Array ( [0] => fn [1] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 0 [5] => and [6] => empty [7] => #0 ) [2] => where [3] => #0 [4] => sign [5] => - [6] => file [7] => #1 [8] => file [9] => #0 [10] => sign [11] => - [12] => rank [13] => #1 [14] => rank [15] => #0 [16] => #1 [17] => and [18] => != [19] => file [20] => #1 [21] => file [22] => #0 [23] => and [24] => != [25] => rank [26] => #1 [27] => rank [28] => #0 [29] => or [30] => checkleap [31] => #0 [32] => #1 [33] => 1 [34] => 1 ) [Griffon-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 1 [4] => 1 [5] => rays [6] => where [7] => #0 [8] => 1 [9] => 1 [10] => 1 [11] => 0 [12] => rays [13] => where [14] => #0 [15] => 1 [16] => -1 [17] => 1 [18] => 0 [19] => rays [20] => where [21] => #0 [22] => -1 [23] => -1 [24] => 1 [25] => 0 [26] => rays [27] => where [28] => #0 [29] => -1 [30] => 1 [31] => 1 [32] => 0 ) [King] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 1 [10] => 0 ) [King-Range] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 1 [4] => 0 [5] => leaps [6] => #0 [7] => 1 [8] => 1 ) [Knight] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 2 [4] => 1 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 2 [10] => 0 ) [Knight-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 2 [4] => 1 [5] => leaps [6] => #0 [7] => 2 [8] => 0 ) [Korean_Elephant] => Array ( [0] => checkpath [1] => #0 [2] => #1 [3] => 1 [4] => 0 [5] => 1 [6] => 1 [7] => 1 [8] => 1 ) [Korean_Elephant-Range] => Array ( [0] => leaps [1] => #0 [2] => 2 [3] => 3 ) [White_Lance] => Array ( [0] => checkaride [1] => #0 [2] => #1 [3] => 0 [4] => 1 ) [White_Lance-Range] => Array ( [0] => ray [1] => #0 [2] => 0 [3] => 1 ) [Black_Lance] => Array ( [0] => checkaride [1] => #0 [2] => #1 [3] => 0 [4] => -1 ) [Black_Lance-Range] => Array ( [0] => ray [1] => #0 [2] => 0 [3] => -1 ) [Leo] => Array ( [0] => fn [1] => Vao [2] => #0 [3] => #1 [4] => or [5] => fn [6] => Cannon [7] => #0 [8] => #1 ) [Leo-Range] => Array ( [0] => merge [1] => rays [2] => #0 [3] => 1 [4] => 0 [5] => rays [6] => #0 [7] => 1 [8] => 1 ) [Mao] => Array ( [0] => checktwostep [1] => #0 [2] => #1 [3] => 0 [4] => 1 [5] => 1 [6] => 1 ) [Mao-Range] => Array ( [0] => leaps [1] => #0 [2] => 1 [3] => 2 ) [Marshall] => Array ( [0] => fn [1] => Knight [2] => #0 [3] => #1 [4] => or [5] => fn [6] => Rook [7] => #0 [8] => #1 ) [Marshall-Range] => Array ( [0] => merge [1] => rays [2] => #0 [3] => 1 [4] => 0 [5] => leaps [6] => #0 [7] => 1 [8] => 2 ) [Moa] => Array ( [0] => checktwostep [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => 0 [6] => 1 ) [Moa-Range] => Array ( [0] => leaps [1] => #0 [2] => 1 [3] => 2 ) [Murray_Lion] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 0 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 1 [10] => 1 [11] => and [12] => cond [13] => empty [14] => #0 [15] => capture [16] => Array ( [0] => not [1] => empty [2] => #1 ) [17] => or [18] => checkleap [19] => #0 [20] => #1 [21] => 2 [22] => 2 [23] => or [24] => checkleap [25] => #0 [26] => #1 [27] => 0 [28] => 2 ) [Murray_Lion-Range] => Array ( [0] => merge [1] => merge [2] => leaps [3] => #0 [4] => 2 [5] => 0 [6] => leaps [7] => #0 [8] => 2 [9] => 2 [10] => merge [11] => leaps [12] => #0 [13] => 1 [14] => 0 [15] => leaps [16] => #0 [17] => 1 [18] => 1 ) [Nightrider] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 2 ) [Nightrider-Range] => Array ( [0] => rays [1] => #0 [2] => 1 [3] => 2 ) [White_Pawn] => Array ( [0] => remove [1] => var [2] => ep [3] => and [4] => < [5] => rankname [6] => #1 [7] => var [8] => bpr [9] => and [10] => < [11] => rankname [12] => var [13] => ep [14] => rankname [15] => #1 [16] => and [17] => == [18] => filename [19] => var [20] => ep [21] => filename [22] => #1 [23] => and [24] => checkleap [25] => #0 [26] => #1 [27] => 1 [28] => 1 [29] => and [30] => var [31] => ep [32] => or [33] => and [34] => checkride [35] => #0 [36] => #1 [37] => 0 [38] => 1 [39] => == [40] => rankname [41] => #0 [42] => var [43] => wpr [44] => or [45] => checkleap [46] => #0 [47] => #1 [48] => 0 [49] => 1 [50] => and [51] => empty [52] => #1 [53] => and [54] => != [55] => var [56] => movetype [57] => CHECK [58] => or [59] => and [60] => not [61] => empty [62] => #1 [63] => checkleap [64] => #0 [65] => #1 [66] => 1 [67] => 1 [68] => and [69] => any [70] => onboard [71] => where [72] => #1 [73] => 0 [74] => 1 [75] => == [76] => var [77] => movetype [78] => CHECK [79] => count [80] => var [81] => wprom [82] => and [83] => <= [84] => distance [85] => #0 [86] => #1 [87] => var [88] => fps [89] => and [90] => > [91] => rank [92] => #1 [93] => rank [94] => #0 ) [Black_Pawn] => Array ( [0] => remove [1] => var [2] => ep [3] => and [4] => > [5] => rankname [6] => #1 [7] => var [8] => wpr [9] => and [10] => > [11] => rankname [12] => var [13] => ep [14] => rankname [15] => #1 [16] => and [17] => == [18] => filename [19] => var [20] => ep [21] => filename [22] => #1 [23] => and [24] => checkleap [25] => #0 [26] => #1 [27] => 1 [28] => 1 [29] => and [30] => var [31] => ep [32] => or [33] => and [34] => checkride [35] => #0 [36] => #1 [37] => 0 [38] => 1 [39] => == [40] => rankname [41] => #0 [42] => var [43] => bpr [44] => or [45] => checkleap [46] => #0 [47] => #1 [48] => 0 [49] => 1 [50] => and [51] => empty [52] => #1 [53] => and [54] => != [55] => var [56] => movetype [57] => CHECK [58] => or [59] => and [60] => not [61] => empty [62] => #1 [63] => checkleap [64] => #0 [65] => #1 [66] => 1 [67] => 1 [68] => and [69] => any [70] => count [71] => var [72] => bprom [73] => onboard [74] => where [75] => #1 [76] => 0 [77] => -1 [78] => == [79] => var [80] => movetype [81] => CHECK [82] => and [83] => <= [84] => distance [85] => #0 [86] => #1 [87] => var [88] => fps [89] => and [90] => < [91] => rank [92] => #1 [93] => rank [94] => #0 ) [White_Pawn-Range] => Array ( [0] => filter [1] => lambda [2] => Array ( [0] => onboard [1] => #1 ) [3] => mergeall [4] => where [5] => #ori [6] => -1 [7] => 1 [8] => where [9] => #ori [10] => 1 [11] => 1 [12] => values [13] => lambda [14] => Array ( [0] => where [1] => #ori [2] => 0 [3] => #1 ) [15] => range [16] => 1 [17] => var [18] => fps [19] => =ori ) [Black_Pawn-Range] => Array ( [0] => filter [1] => lambda [2] => Array ( [0] => onboard [1] => #1 ) [3] => mergeall [4] => where [5] => #ori [6] => -1 [7] => -1 [8] => where [9] => #ori [10] => 1 [11] => -1 [12] => values [13] => lambda [14] => Array ( [0] => where [1] => #ori [2] => 0 [3] => neg [4] => #1 ) [15] => range [16] => 1 [17] => var [18] => fps [19] => =ori ) [White_Pawn-Promote] => Array ( [0] => var [1] => wprom ) [Black_Pawn-Promote] => Array ( [0] => var [1] => bprom ) [White_Quick_Pawn] => Array ( [0] => remove [1] => var [2] => ep [3] => and [4] => < [5] => rankname [6] => #1 [7] => rankname [8] => var [9] => epf [10] => and [11] => < [12] => rankname [13] => var [14] => ep [15] => rankname [16] => #1 [17] => and [18] => == [19] => filename [20] => var [21] => ep [22] => filename [23] => #1 [24] => and [25] => checkleap [26] => #0 [27] => #1 [28] => 1 [29] => 1 [30] => and [31] => var [32] => ep [33] => or [34] => checkride [35] => #0 [36] => #1 [37] => 0 [38] => 1 [39] => and [40] => empty [41] => #1 [42] => and [43] => != [44] => var [45] => movetype [46] => CHECK [47] => or [48] => and [49] => or [50] => not [51] => empty [52] => #1 [53] => == [54] => var [55] => movetype [56] => CHECK [57] => checkleap [58] => #0 [59] => #1 [60] => 1 [61] => 1 [62] => and [63] => any [64] => onboard [65] => where [66] => #1 [67] => 0 [68] => 1 [69] => == [70] => var [71] => movetype [72] => CHECK [73] => count [74] => var [75] => wprom [76] => and [77] => <= [78] => distance [79] => #0 [80] => #1 [81] => var [82] => fps [83] => and [84] => > [85] => rank [86] => #1 [87] => rank [88] => #0 ) [Black_Quick_Pawn] => Array ( [0] => remove [1] => var [2] => ep [3] => and [4] => > [5] => rankname [6] => #1 [7] => rankname [8] => var [9] => epf [10] => and [11] => > [12] => rankname [13] => var [14] => ep [15] => rankname [16] => #1 [17] => and [18] => == [19] => filename [20] => var [21] => ep [22] => filename [23] => #1 [24] => and [25] => checkleap [26] => #0 [27] => #1 [28] => 1 [29] => 1 [30] => and [31] => var [32] => ep [33] => or [34] => checkride [35] => #0 [36] => #1 [37] => 0 [38] => 1 [39] => and [40] => empty [41] => #1 [42] => and [43] => != [44] => var [45] => movetype [46] => CHECK [47] => or [48] => and [49] => or [50] => not [51] => empty [52] => #1 [53] => == [54] => var [55] => movetype [56] => CHECK [57] => checkleap [58] => #0 [59] => #1 [60] => 1 [61] => 1 [62] => and [63] => any [64] => count [65] => var [66] => bprom [67] => onboard [68] => where [69] => #1 [70] => 0 [71] => -1 [72] => == [73] => var [74] => movetype [75] => CHECK [76] => and [77] => <= [78] => distance [79] => #0 [80] => #1 [81] => var [82] => fps [83] => and [84] => < [85] => rank [86] => #1 [87] => rank [88] => #0 ) [White_Quick_Pawn-Range] => Array ( [0] => filter [1] => lambda [2] => Array ( [0] => onboard [1] => #1 ) [3] => mergeall [4] => where [5] => #ori [6] => -1 [7] => 1 [8] => where [9] => #ori [10] => 1 [11] => 1 [12] => values [13] => lambda [14] => Array ( [0] => where [1] => #ori [2] => 0 [3] => #1 ) [15] => range [16] => 1 [17] => var [18] => fps [19] => =ori ) [Black_Quick_Pawn-Range] => Array ( [0] => filter [1] => lambda [2] => Array ( [0] => onboard [1] => #1 ) [3] => mergeall [4] => where [5] => #ori [6] => -1 [7] => -1 [8] => where [9] => #ori [10] => 1 [11] => -1 [12] => values [13] => lambda [14] => Array ( [0] => where [1] => #ori [2] => 0 [3] => neg [4] => #1 ) [15] => range [16] => 1 [17] => var [18] => fps [19] => =ori ) [White_Quick_Pawn-Promote] => Array ( [0] => var [1] => wprom ) [Black_Quick_Pawn-Promote] => Array ( [0] => var [1] => bprom ) [Queen] => Array ( [0] => fn [1] => Rook [2] => #0 [3] => #1 [4] => or [5] => fn [6] => Bishop [7] => #0 [8] => #1 [9] => or [10] => fn [11] => Bombard [12] => #0 [13] => #1 [14] => or [15] => fn [16] => Arbalest [17] => #0 [18] => #1 ) [Queen-Range] => Array ( [0] => merge [1] => rays [2] => #0 [3] => 1 [4] => 0 [5] => rays [6] => #0 [7] => 1 [8] => 1 ) [Rhino] => Array ( [0] => windingride [1] => #0 [2] => #1 [3] => 1 [4] => 0 [5] => 1 [6] => 1 [7] => or [8] => windingride [9] => #0 [10] => #1 [11] => 0 [12] => 1 [13] => 1 [14] => 1 ) [Rhino-Range] => Array ( [0] => merge [1] => eval [2] => Array ( [0] => windingrays [1] => #0 [2] => 1 [3] => 0 [4] => 1 [5] => 1 ) [3] => windingrays [4] => #0 [5] => 0 [6] => 1 [7] => 1 [8] => 1 ) [Rook] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 0 ) [Rook-Range] => Array ( [0] => rays [1] => #0 [2] => 1 [3] => 0 ) [Short_Rook] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 0 [5] => and [6] => <= [7] => distance [8] => #0 [9] => #1 [10] => 4 ) [Short_Rook-Range] => Array ( [0] => merge [1] => merge [2] => leaps [3] => #0 [4] => 1 [5] => 0 [6] => leaps [7] => #0 [8] => 2 [9] => 0 [10] => merge [11] => leaps [12] => #0 [13] => 3 [14] => 0 [15] => leaps [16] => #0 [17] => 4 [18] => 0 ) [White_Shogi_Knight] => Array ( [0] => checkaleap [1] => #0 [2] => #1 [3] => 1 [4] => 2 [5] => or [6] => checkaleap [7] => #0 [8] => #1 [9] => -1 [10] => 2 ) [White_Shogi_Knight-Range] => Array ( [0] => array [1] => where [2] => #0 [3] => 1 [4] => 2 [5] => where [6] => #0 [7] => -1 [8] => 2 ) [Black_Shogi_Knight] => Array ( [0] => checkaleap [1] => #0 [2] => #1 [3] => 1 [4] => -2 [5] => or [6] => checkaleap [7] => #0 [8] => #1 [9] => -1 [10] => -2 ) [Black_Shogi_Knight-Range] => Array ( [0] => array [1] => where [2] => #0 [3] => 1 [4] => -2 [5] => where [6] => #0 [7] => -1 [8] => -2 ) [White_Shogi_Pawn] => Array ( [0] => checkaleap [1] => #0 [2] => #1 [3] => 0 [4] => 1 ) [White_Shogi_Pawn-Range] => Array ( [0] => array [1] => where [2] => #0 [3] => 0 [4] => 1 ) [Black_Shogi_Pawn] => Array ( [0] => checkaleap [1] => #0 [2] => #1 [3] => 0 [4] => -1 ) [Black_Shogi_Pawn-Range] => Array ( [0] => array [1] => where [2] => #0 [3] => 0 [4] => -1 ) [White_Silver_General] => Array ( [0] => checkaleap [1] => #0 [2] => #1 [3] => 0 [4] => 1 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 1 [10] => 1 ) [White_Silver_General-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 1 [4] => 1 [5] => where [6] => #0 [7] => 0 [8] => 1 ) [Black_Silver_General] => Array ( [0] => checkaleap [1] => #0 [2] => #1 [3] => 0 [4] => -1 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 1 [10] => 1 ) [Black_Silver_General-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 1 [4] => 1 [5] => where [6] => #0 [7] => 0 [8] => -1 ) [Squirrel] => Array ( [0] => fn [1] => Elephant [2] => #0 [3] => #1 [4] => or [5] => fn [6] => Dabbabah [7] => #0 [8] => #1 [9] => or [10] => fn [11] => Knight [12] => #0 [13] => #1 ) [Squirrel-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 2 [4] => 2 [5] => leaps [6] => #0 [7] => 2 [8] => 0 [9] => leaps [10] => #0 [11] => 1 [12] => 2 ) [Spider] => Array ( [0] => fn [1] => Dabbabah [2] => #0 [3] => #1 [4] => or [5] => fn [6] => Elephant [7] => #0 [8] => #1 ) [Spider-Range] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 2 [4] => 2 [5] => leaps [6] => #0 [7] => 0 [8] => 2 ) [Spider-rider] => Array ( [0] => fn [1] => Dabbabahrider [2] => #0 [3] => #1 [4] => or [5] => fn [6] => Elephantrider [7] => #0 [8] => #1 ) [Spider-rider-Range] => Array ( [0] => merge [1] => rays [2] => #0 [3] => 2 [4] => 2 [5] => rays [6] => #0 [7] => 0 [8] => 2 ) [Squire] => Array ( [0] => checktwostep [1] => #0 [2] => #1 [3] => 0 [4] => 1 [5] => 1 [6] => 1 [7] => or [8] => checktwostep [9] => #0 [10] => #1 [11] => 1 [12] => 1 [13] => 0 [14] => 1 ) [Squire-Range] => Array ( [0] => leaps [1] => #0 [2] => 1 [3] => 2 ) [Unicorn] => Array ( [0] => fn [1] => Nightrider [2] => #0 [3] => #1 [4] => or [5] => fn [6] => Bishop [7] => #0 [8] => #1 ) [Unicorn-Range] => Array ( [0] => merge [1] => rays [2] => #0 [3] => 1 [4] => 2 [5] => rays [6] => #0 [7] => 1 [8] => 1 ) [Vao] => Array ( [0] => cond [1] => cond [2] => empty [3] => #0 [4] => capture [5] => Array ( [0] => not [1] => empty [2] => #1 ) [6] => Array ( [0] => checkhop [1] => #0 [2] => #1 [3] => 1 [4] => 1 ) [7] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 1 ) [8] => and [9] => #1 ) [Vao-Range] => Array ( [0] => rays [1] => #0 [2] => 1 [3] => 1 ) [Wazir] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 0 ) [Wazir-Range] => Array ( [0] => leaps [1] => #0 [2] => 1 [3] => 0 ) [Wizard] => Array ( [0] => fn [1] => Ferz [2] => #0 [3] => #1 [4] => or [5] => fn [6] => Camel [7] => #0 [8] => #1 ) [Wizard-Range] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 1 [4] => 1 [5] => leaps [6] => #0 [7] => 1 [8] => 3 ) [Woody_Rook] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 0 [4] => 2 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 0 [10] => 1 ) [Woody_Rook-Range] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 0 [4] => 1 [5] => leaps [6] => #0 [7] => 0 [8] => 2 ) [Zebra] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 2 [4] => 3 ) [Zebra-Range] => Array ( [0] => leaps [1] => #0 [2] => 2 [3] => 3 ) [Elephant_Ferz] => Array ( [0] => fn [1] => Ferz [2] => #0 [3] => #1 [4] => or [5] => fn [6] => Elephant [7] => #0 [8] => #1 ) [Elephant_Ferz-Range] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 2 [4] => 2 [5] => leaps [6] => #0 [7] => 1 [8] => 1 ) [Elephant_Wazir] => Array ( [0] => fn [1] => Wazir [2] => #0 [3] => #1 [4] => or [5] => fn [6] => Elephant [7] => #0 [8] => #1 ) [Elephant_Wazir-Range] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 2 [4] => 2 [5] => leaps [6] => #0 [7] => 1 [8] => 0 ) [Kylin] => Array ( [0] => fn [1] => Ferz [2] => #0 [3] => #1 [4] => or [5] => fn [6] => Dabbabah [7] => #0 [8] => #1 ) [Kylin-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 1 [4] => 1 [5] => leaps [6] => #0 [7] => 2 [8] => 0 ) [Half_Duck] => Array ( [0] => fn [1] => Ferz [2] => #0 [3] => #1 [4] => or [5] => fn [6] => Dabbabah [7] => #0 [8] => #1 [9] => or [10] => checkleap [11] => #0 [12] => #1 [13] => 3 [14] => 0 ) [Half_Duck-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 1 [4] => 1 [5] => leaps [6] => #0 [7] => 2 [8] => 0 [9] => leaps [10] => #0 [11] => 3 [12] => 0 ) [Knight_Wazir] => Array ( [0] => fn [1] => Knight [2] => #0 [3] => #1 [4] => or [5] => fn [6] => Wazir [7] => #0 [8] => #1 ) [Knight_Wazir-Range] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 1 [4] => 2 [5] => leaps [6] => #0 [7] => 1 [8] => 0 ) [Frog] => Array ( [0] => fn [1] => Ferz [2] => #0 [3] => #1 [4] => or [5] => checkleap [6] => #0 [7] => #1 [8] => 3 [9] => 0 ) [Frog-Range] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 1 [4] => 1 [5] => leaps [6] => #0 [7] => 3 [8] => 0 ) [Buffalo] => Array ( [0] => fn [1] => Knight [2] => #0 [3] => #1 [4] => or [5] => fn [6] => Camel [7] => #0 [8] => #1 [9] => or [10] => fn [11] => Zebra [12] => #0 [13] => #1 ) [Buffalo-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 1 [4] => 2 [5] => leaps [6] => #0 [7] => 1 [8] => 3 [9] => leaps [10] => #0 [11] => 2 [12] => 3 ) [@] => Array ( [0] => false ) [checked] => Array ( [0] => anytrue [1] => lambda [2] => Array ( [0] => fn [1] => const [2] => alias [3] => #0 [4] => var [5] => key [6] => var [7] => king ) [3] => cond [4] => isupper [5] => space [6] => var [7] => king [8] => Array ( [0] => onlylower ) [9] => Array ( [0] => onlyupper ) [10] => =movetype [11] => CHECK [12] => =king ) [threatened] => Array ( [0] => anytrue [1] => lambda [2] => Array ( [0] => fn [1] => const [2] => alias [3] => space [4] => #0 [5] => #0 [6] => var [7] => king ) [3] => elem [4] => var [5] => king [6] => threats [7] => =movetype [8] => CHECK [9] => =king ) [Kirin] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 2 [4] => 0 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 1 [10] => 1 ) [Kirin-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 1 [4] => 1 [5] => leaps [6] => #0 [7] => 2 [8] => 0 ) [Phoenix] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 2 [4] => 2 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 1 [10] => 0 ) [Phoenix-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 2 [4] => 2 [5] => leaps [6] => #0 [7] => 1 [8] => 0 ) [Black_Drunk_Elephant] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => or [6] => checkaleap [7] => #0 [8] => #1 [9] => 1 [10] => 0 [11] => or [12] => checkaleap [13] => #0 [14] => #1 [15] => -1 [16] => 0 [17] => or [18] => checkaleap [19] => #0 [20] => #1 [21] => 0 [22] => -1 ) [Black_Drunk_Elephant-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 1 [4] => 1 [5] => where [6] => #0 [7] => -1 [8] => 0 [9] => where [10] => #0 [11] => 1 [12] => 0 [13] => where [14] => #0 [15] => 0 [16] => -1 ) [White_Drunk_Elephant] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => or [6] => checkaleap [7] => #0 [8] => #1 [9] => 1 [10] => 0 [11] => or [12] => checkaleap [13] => #0 [14] => #1 [15] => -1 [16] => 0 [17] => or [18] => checkaleap [19] => #0 [20] => #1 [21] => 0 [22] => 1 ) [White_Drunk_Elephant-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 1 [4] => 1 [5] => where [6] => #0 [7] => -1 [8] => 0 [9] => where [10] => #0 [11] => 1 [12] => 0 [13] => where [14] => #0 [15] => 0 [16] => 1 ) [Black_Copper_General] => Array ( [0] => checkaleap [1] => #0 [2] => #1 [3] => 1 [4] => -1 [5] => or [6] => checkaleap [7] => #0 [8] => #1 [9] => 0 [10] => -1 [11] => or [12] => checkaleap [13] => #0 [14] => #1 [15] => -1 [16] => -1 [17] => or [18] => checkaleap [19] => #0 [20] => #1 [21] => 0 [22] => 1 ) [Black_Copper_General-Range] => Array ( [0] => mergeall [1] => where [2] => #0 [3] => 1 [4] => -1 [5] => where [6] => #0 [7] => 0 [8] => -1 [9] => where [10] => #0 [11] => -1 [12] => -1 [13] => where [14] => #0 [15] => 0 [16] => 1 ) [White_Copper_General] => Array ( [0] => checkaleap [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => or [6] => checkaleap [7] => #0 [8] => #1 [9] => 0 [10] => 1 [11] => or [12] => checkaleap [13] => #0 [14] => #1 [15] => -1 [16] => 1 [17] => or [18] => checkaleap [19] => #0 [20] => #1 [21] => 0 [22] => -1 ) [White_Copper_General-Range] => Array ( [0] => mergeall [1] => where [2] => #0 [3] => 1 [4] => 1 [5] => where [6] => #0 [7] => 0 [8] => 1 [9] => where [10] => #0 [11] => -1 [12] => 1 [13] => where [14] => #0 [15] => 0 [16] => -1 ) [Bombard] => Array ( [0] => checkhop [1] => #0 [2] => #1 [3] => 1 [4] => 0 ) [Bombard-Range] => Array ( [0] => rays [1] => #0 [2] => 1 [3] => 0 ) [Arbalest] => Array ( [0] => checkhop [1] => #0 [2] => #1 [3] => 1 [4] => 1 ) [Arbalest-Range] => Array ( [0] => rays [1] => #0 [2] => 1 [3] => 1 ) [Condor] => Array ( [0] => fn [1] => Array ( [0] => checkaride [1] => #0 [2] => #1 [3] => 0 [4] => 1 [5] => and [6] => empty [7] => #0 ) [2] => where [3] => #0 [4] => 2 [5] => 2 [6] => #1 [7] => or [8] => fn [9] => Array ( [0] => checkaride [1] => #0 [2] => #1 [3] => 1 [4] => 0 [5] => and [6] => empty [7] => #0 ) [10] => where [11] => #0 [12] => 2 [13] => 2 [14] => #1 [15] => or [16] => fn [17] => Array ( [0] => checkaride [1] => #0 [2] => #1 [3] => 0 [4] => 1 [5] => and [6] => empty [7] => #0 ) [18] => where [19] => #0 [20] => -2 [21] => 2 [22] => #1 [23] => or [24] => fn [25] => Array ( [0] => checkaride [1] => #0 [2] => #1 [3] => -1 [4] => 0 [5] => and [6] => empty [7] => #0 ) [26] => where [27] => #0 [28] => -2 [29] => 2 [30] => #1 [31] => or [32] => fn [33] => Array ( [0] => checkaride [1] => #0 [2] => #1 [3] => 0 [4] => -1 [5] => and [6] => empty [7] => #0 ) [34] => where [35] => #0 [36] => -2 [37] => -2 [38] => #1 [39] => or [40] => fn [41] => Array ( [0] => checkaride [1] => #0 [2] => #1 [3] => -1 [4] => 0 [5] => and [6] => empty [7] => #0 ) [42] => where [43] => #0 [44] => -2 [45] => -2 [46] => #1 [47] => or [48] => fn [49] => Array ( [0] => checkaride [1] => #0 [2] => #1 [3] => 0 [4] => -1 [5] => and [6] => empty [7] => #0 ) [50] => where [51] => #0 [52] => 2 [53] => -2 [54] => #1 [55] => or [56] => fn [57] => Array ( [0] => checkaride [1] => #0 [2] => #1 [3] => 1 [4] => 0 [5] => and [6] => empty [7] => #0 ) [58] => where [59] => #0 [60] => 2 [61] => -2 [62] => #1 [63] => or [64] => checkleap [65] => #0 [66] => #1 [67] => 2 [68] => 2 ) [Condor-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 2 [4] => 2 [5] => ray [6] => where [7] => #0 [8] => 2 [9] => 2 [10] => 0 [11] => 1 [12] => ray [13] => where [14] => #0 [15] => 2 [16] => 2 [17] => 1 [18] => 0 [19] => ray [20] => where [21] => #0 [22] => -2 [23] => 2 [24] => 0 [25] => 1 [26] => ray [27] => where [28] => #0 [29] => -2 [30] => 2 [31] => -1 [32] => 0 [33] => ray [34] => where [35] => #0 [36] => -2 [37] => -2 [38] => 0 [39] => -1 [40] => ray [41] => where [42] => #0 [43] => -2 [44] => -2 [45] => -1 [46] => 0 [47] => ray [48] => where [49] => #0 [50] => 2 [51] => -2 [52] => 0 [53] => -1 [54] => ray [55] => where [56] => #0 [57] => 2 [58] => -2 [59] => 1 [60] => 0 ) [Lion] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 3 [4] => 1 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 3 [10] => 0 ) [Lion-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 3 [4] => 1 [5] => leaps [6] => #0 [7] => 3 [8] => 0 ) [Lion-Desc] => Array ( [0] => The %s is from Grant Acedrex. It makes a 3,1 leap or a 3,0 leap, in any direction. ) [Rhinoceros] => Array ( [0] => fn [1] => Array ( [0] => checkaride [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => and [6] => empty [7] => #0 ) [2] => where [3] => #0 [4] => 1 [5] => 2 [6] => #1 [7] => or [8] => fn [9] => Array ( [0] => checkaride [1] => #0 [2] => #1 [3] => 1 [4] => -1 [5] => and [6] => empty [7] => #0 ) [10] => where [11] => #0 [12] => 1 [13] => -2 [14] => #1 [15] => or [16] => fn [17] => Array ( [0] => checkaride [1] => #0 [2] => #1 [3] => -1 [4] => 1 [5] => and [6] => empty [7] => #0 ) [18] => where [19] => #0 [20] => -1 [21] => 2 [22] => #1 [23] => or [24] => fn [25] => Array ( [0] => checkaride [1] => #0 [2] => #1 [3] => -1 [4] => -1 [5] => and [6] => empty [7] => #0 ) [26] => where [27] => #0 [28] => -1 [29] => -2 [30] => #1 [31] => or [32] => fn [33] => Array ( [0] => checkaride [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => and [6] => empty [7] => #0 ) [34] => where [35] => #0 [36] => 2 [37] => 1 [38] => #1 [39] => or [40] => fn [41] => Array ( [0] => checkaride [1] => #0 [2] => #1 [3] => 1 [4] => -1 [5] => and [6] => empty [7] => #0 ) [42] => where [43] => #0 [44] => 2 [45] => -1 [46] => #1 [47] => or [48] => fn [49] => Array ( [0] => checkaride [1] => #0 [2] => #1 [3] => -1 [4] => 1 [5] => and [6] => empty [7] => #0 ) [50] => where [51] => #0 [52] => -2 [53] => 1 [54] => #1 [55] => or [56] => fn [57] => Array ( [0] => checkaride [1] => #0 [2] => #1 [3] => -1 [4] => -1 [5] => and [6] => empty [7] => #0 ) [58] => where [59] => #0 [60] => -2 [61] => -1 [62] => #1 [63] => or [64] => checkleap [65] => #0 [66] => #1 [67] => 2 [68] => 1 ) [Rhinoceros-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 2 [4] => 1 [5] => ray [6] => where [7] => #0 [8] => 1 [9] => 2 [10] => 1 [11] => 1 [12] => ray [13] => where [14] => #0 [15] => 1 [16] => -2 [17] => 1 [18] => -1 [19] => ray [20] => where [21] => #0 [22] => -1 [23] => 2 [24] => -1 [25] => 1 [26] => ray [27] => where [28] => #0 [29] => -1 [30] => -2 [31] => -1 [32] => -1 [33] => ray [34] => where [35] => #0 [36] => 2 [37] => 1 [38] => 1 [39] => 1 [40] => ray [41] => where [42] => #0 [43] => 2 [44] => -1 [45] => 1 [46] => -1 [47] => ray [48] => where [49] => #0 [50] => -2 [51] => 1 [52] => -1 [53] => 1 [54] => ray [55] => where [56] => #0 [57] => -2 [58] => -1 [59] => -1 [60] => -1 ) [Osprey] => Array ( [0] => fn [1] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => and [6] => empty [7] => #0 ) [2] => where [3] => #0 [4] => 0 [5] => * [6] => 2 [7] => sign [8] => - [9] => rank [10] => #1 [11] => rank [12] => #0 [13] => #1 [14] => or [15] => fn [16] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => and [6] => empty [7] => #0 ) [17] => where [18] => #0 [19] => * [20] => 2 [21] => sign [22] => - [23] => file [24] => #1 [25] => file [26] => #0 [27] => 0 [28] => #1 [29] => and [30] => not [31] => checkleap [32] => #0 [33] => #1 [34] => 1 [35] => 1 [36] => or [37] => checkleap [38] => #0 [39] => #1 [40] => 2 [41] => 0 ) [Osprey-Range] => Array ( [0] => mergeall [1] => leaps [2] => #0 [3] => 2 [4] => 0 [5] => rays [6] => where [7] => #0 [8] => 0 [9] => 2 [10] => 1 [11] => 1 [12] => rays [13] => where [14] => #0 [15] => 0 [16] => -2 [17] => 1 [18] => 1 [19] => rays [20] => where [21] => #0 [22] => 2 [23] => 0 [24] => 1 [25] => 1 [26] => rays [27] => where [28] => #0 [29] => -2 [30] => 0 [31] => 1 [32] => 1 ) [enemies] => Array ( [0] => onlylower ) )uservar
Array ( [0] => Array ( [main] => Array ( [message] => Set the wpr variable to the value of White's Pawn Rank. This is the single rank on which all of White's Pawns start. This would be 2 for Chess.
[ep] => [Aanca-Desc] => The %s may move one space orthgonally, and so long as it is unblocked, it may continue its move in an outward diagonal direction. [Amazon-Desc] => The %s may move in a straight line in any direction, as a Queen does, or it may leap the the opposite end of a 1x2 rectangle, as a Knight does. [Bede-Desc] => The %s may move along any diagonal line, as a Bishop does, or it may leap two spaces away in any orthogonal direction, as a Dabababah does. [White_Berolina_Pawn-Desc] => The %s may move one space diagonally forward without capturing, or it may move one space straight forward to capture. On its first move, it may move two spaces diagonally forward without capturing so long as it isn't blocked. If this move takes it next to an enemy %s that could have captured it if it had just moved one space, that %s may immediately capture it by en passant, moving to the space it passed over. On reaching the last rank, it may promote. [Black_Berolina_Pawn-Desc] => The %s may move one space diagonally forward without capturing, or it may move one space straight forward to capture. On its first move, it may move two spaces diagonally forward without capturing so long as it isn't blocked. If this move takes it next to an enemy %s that could have captured it if it had just moved one space, that %s may immediately capture it by en passant, moving to the space it passed over. On reaching the last rank, it may promote. [Bishop-Desc] => The %s may move diagonally any number of spaces until it reaches an occupied space. [Cannon-Desc] => The %s moves any number of spaces orthogonally, as a Rook does, but it must hop over an intervening piece to capture. [Camel-Desc] => The %s leaps to any space at the opposite corner of a 1x3 rectangle. [Camelrider-Desc] => The %s may make any number of Camel moves in the same direction until it lands on an occupied space. [Cardinal-Desc] => The %s may move along diagonals as a Bishop or leap as a Knight. [Centaur-Desc] => The %s may move to any adjacent space as a King or leap like a Knight. [Champion-Desc] => The %s may leap one or two spaces orthogonally or two spaces diagonally. [White_Charging_Knight-Desc] => The %s may leap forward as a Knight or move one space sideways or backwards like a King. [Black_Charging_Knight-Desc] => The %s may leap forward as a Knight or move one space sideways or backwards like a King. [White_Charging_Rook-Desc] => The %s may move forward or sideways along its file or rank like a Rook, or it may move one space backwards in any direction like a King. [Black_Charging_Rook-Desc] => The %s may move forward or sideways along its file or rank like a Rook, or it may move one space backwards in any direction like a King. [Chinese_Elephant-Desc] => The %s may move two spaces diagonally so long as the space in between is empty. [White_Chinese_Elephant-Desc] => The %s may move two spaces diagonally so long as the space in between is empty, but it is confined to the ranks on its own side of the board. [Black_Chinese_Elephant-Desc] => The %s may move two spaces diagonally so long as the space in between is empty, but it is confined to the ranks on its own side of the board. [Chinese_General-Desc] => The %s may move one space orthogonally within the confines of the Palace, but it may not face the opponent's %s along an open file. [Chinese_Guard-Desc] => The %s may move one space diagonally within the confines of the palace. [White_Chinese_Pawn-Desc] => The %s may move one space forward. Once it has reached the other side of the board, it may also move one space sideways. [Black_Chinese_Pawn-Desc] => The %s may move one space forward. Once it has reached the other side of the board, it may also move one space sideways. [White_Colonel-Desc] => The %s may move forward or sideways as a Rook, forward as a Knight, and one space in any direction as a King. [Black_Colonel-Desc] => The %s may move forward or sideways as a Rook, forward as a Knight, and one space in any direction as a King. [Dabbabah-Desc] => The %s may leap two spaces vertically or horizontally. [Dabbabahrider-Desc] => The %s may make any number of two space orthogonal leaps in the same direction until it reaches an occupied space. [Dragon_Horse-Desc] => The %s may move along diagonals as a Bishop or move one space orthogonally as a Wazir. [Dragon_King-Desc] => The %s may move along its rank or file as a Rook or one space diagonally as a Ferz. [Elephant-Desc] => The %s may leap two spaces in any diagonal direction. [Elephantrider-Desc] => The %s may make a series of two-space diagonal leaps in the same direction. Each leap but the last must be to an empty space, though a leap may take it over an intervening piece. [Eques_Rex-Desc] => The %s may move to any adjacent space as a King or leap like a Knight. [Fad-Desc] => The %s may move one space diagonally, or it may leap two spaces diagonally or orthogonally. [Ferz-Desc] => The %s may move one space diagonally. [Fibnif-Desc] => The %s may move one space diagonally or leap as a Knight to any space that is one file and two ranks away. [Giraffe-Desc] => The %s may leap to any space that is one file and four ranks or one rank and four files away. [White_Gold_General-Desc] => The %s may move one space in any orthgonal direction or one space diagonally forward. [Black_Gold_General-Desc] => The %s may move one space in any orthgonal direction or one space diagonally forward. [The %s moves any number of spaces orthogonally or diagonally like a Queen except that it must hop over exactly one piece, and it must end its move immediately after the piece it hopped over] => Array ( [] => ) [Griffon-Desc] => The %s may move one space diagonally, and it may continue its move by moving as a Rook in an outward orthogonal direction. It may not pass over other pieces. [King-Desc] => The %s leaps one space in any direction. It may castle with a Rook on its first move so long as it is not in check, there is nothing in between it and the Rook, it doesn't pass through check while castling, and the Rook hasn't moved. In castling, it moves two spaces toward the Rook, and the Rook moves to the space the %s passed over. [Knight-Desc] => The %s in this game makes a 2,1 leap or a 2,0 leap. [The %s may move one space orthogonally, followed by two more spaces in the same outward diagonal direction] => Array ( [ It must complete every part of its move, and it may not pass over an occupied space] => Array ( [] => ) ) [The %s may move forward in its file as a Rook] => Array ( [] => ) [Leo-Desc] => The %s may move any number of spaces diagonally or orthogonally, as a Queen does, but it must hop over one intervening piece when it captures. [Mao-Desc] => The %s moves one space orthogonally, followed by one more space in an outward diagonal direction. It must complete both parts of its move, and it may not pass over an occupied space. It can reach the same spaces as a Knight except that it can be blocked on the first step of its two-space move. [Marshall-Desc] => The %s moves orthogonally as a Rook or leaps as a Knight. [Moa-Desc] => The %s moves one space diagonally, followed by one more space in an outward orthogonal direction. It must complete both parts of its move, and it may not pass over an occupied space. It can reach the same spaces as a Knight except that it can be blocked on the first step of its two-space move. [Murray_Lion-Desc] => The %s may leap two spaces in any diagonal or orthogonal direction, and it may capture (but not otherwise move) one space in any direction. [Nightrider-Desc] => The %s may leap as a Knight any number of times in the same direction. While each Knight leap may take it over other pieces, each leap but the last must be to an empty space. [White_Pawn-Desc] => The %s may move one space straight forward without capturing, or it may move one space diagonally forward to capture. On its first move, it may move two spaces forward without capturing so long as it isn't blocked. If this move takes it over a space an enemy %s could have captured it on if it had moved there, that %s may immediately capture it by en passant by moving to that space. On reaching the last rank, it must promote to any other piece except the King. [Black_Pawn-Desc] => The %s may move one space straight forward without capturing, or it may move one space diagonally forward to capture. On its first move, it may move two spaces forward without capturing so long as it isn't blocked. If this move takes it over a space an enemy %s could have captured it on if it had moved there, that %s may immediately capture it by en passant by moving to that space. On reaching the last rank, it must promote to any other piece except the King. [White_Quick_Pawn-Desc] => The %s may move one or two spaces straight forward without capturing, or it may move one space diagonally forward to capture. If its two-space move takes it over a space an enemy %s could have captured it on if it had moved there, that %s may immediately capture it by en passant by moving to that space. On reaching the last rank, it must promote to any other piece except the King. [Black_Quick_Pawn-Desc] => The %s may move one or two spaces straight forward without capturing, or it may move one space diagonally forward to capture. If its two-space move takes it over a space an enemy %s could have captured it on if it had moved there, that %s may immediately capture it by en passant by moving to that space. On reaching the last rank, it must promote to any other piece except the King. [Queen-Desc] => The %s in this game combines the moves of Rook, Bishop, Bombard, and Arbalest. [Rhino-Desc] => The %s moves along a winding path that alternates between the same one-space orthogonal move and the same one-space diagonal move both in the same general direction. [Rook-Desc] => The %s may move any number of spaces in any vertical or horizontal direction until it reaches an occupied space. [The %s may move up to four spaces along its rank or file as a Rook] => Array ( [] => ) [White_Shogi_Knight-Desc] => The %s may leap to either space that is two ranks ahead and one file to the side. [Black_Shogi_Knight-Desc] => The %s may leap to either space that is two ranks ahead and one file to the side. [White_Shogi_Pawn-Desc] => The %s map move one space forward in the same file. [Black_Shogi_Pawn-Desc] => The %s map move one space forward in the same file. [White_Silver_General-Desc] => The %s may move one space in any diagonal direction or one space vertically foward. [Black_Silver_General-Desc] => The %s may move one space in any diagonal direction or one space vertically foward. [Squirrel-Desc] => The %s may leap any non-adjacent space that is no more than two spaces away. [Spider-Desc] => The %s may leap to any space that is two spaces away orthogonally or diagonally. [Spider-rider-Desc] => The %s may make any number of two-space leaps in a single orthogonal or diagonal direction. While each leap may take it over an occupied space, each leap but the last must be to an empty space. [Squire-Desc] => The %s may move one space orthogonally, followed by one more space in an outward diagonal direction, or it may move one space diagonally, followed by one more space in an outward orthogonal direction. It must complete both parts of its move, and it may not pass over an occupied space. It can reach the same spaces as a Knight except that it can be blocked on the first step of its two-space move. [Unicorn-Desc] => The %s may make consecutive Knight moves in the same direction, as a Nightrider does, or it may move diagonally as a Bishop. [Vao-Desc] => The %s may move diagonally as a Bishop, but it must hop over exactly one intervening piece when it captures. [Wazir-Desc] => The %s may move one space horizontally or vertically. [Wizard-Desc] => The %s may move one space diagonally, or it may leap to a space three ranks and one file or three files and one rank away, as a Camel does. [Woody_Rook-Desc] => The %s may leap one or two spaces orthogonally. It may pass over another piece when moving two spaces. [Zebra-Desc] => The %s may leap to any space that is 2 ranks and 3 files or 2 files and 3 ranks away. [Elephant_Ferz-Desc] => The %s may leap one or two spaces diagonally. It may pass over another piece when moving two spaces. [Elephant_Wazir-Desc] => The %s may move one space orthogonally, as a Wazir, or leap two spaces diagonally, as an Elephant. [Kylin-Desc] => The %s may move one space diagonally, or it may leap 2 spaces orthogonally, passing over any pieces in the way. [Half_Duck-Desc] => The %s may move one space diagonally, or it may leap 2 or 3 spaces orthogonally, passing over any pieces in the way. [Knight_Wazir-Desc] => The %s may move one space orthogonally, as a Wazir, or it may leap as a Knight to any space one file and two ranks or two files and one rank away. [Frog-Desc] => The %s may move one space diagonally or directly leap 3 spaces orthogonally. [Buffalo-Desc] => The %s Buffalo may leap (1, 2) as a Knight, (1, 3) as a Camel, or (2, 3) as a Zebra. [mypieces] => Array ( [k] => Array ( ) [K] => Array ( ) [q] => Array ( ) [Q] => Array ( ) [r] => Array ( ) [R] => Array ( ) [b] => Array ( ) [B] => Array ( ) [z] => Array ( ) [Z] => Array ( ) [l] => Array ( ) [L] => Array ( ) [p] => Array ( ) [P] => Array ( ) [U] => wrhino.gif [u] => brhino.gif [N] => ../alfaeriemisc/wheeler/wknightwarmachine.gif [n] => ../alfaeriemisc/wheeler/bknightwarmachine.gif [O] => wbird.gif [o] => bbird.gif [Y] => wgryphon.gif [y] => bgryphon.gif [D] => wbird2.gif [d] => bbird2.gif [A] => wvao.gif [a] => bvao.gif [M] => wcannon.gif [m] => bcannon.gif [E] => ../alfaerie5a/wdrunkelephant.gif [e] => ../alfaerie5a/bdrunkelephant.gif [G] => wgoldgeneral.gif [g] => bgoldgeneral.gif [S] => wsilvergeneral.gif [s] => bsilvergeneral.gif [C] => ../alfaerie5/wcoppergeneral.gif [c] => ../alfaerie5/bcoppergeneral.gif [I] => ../alfaeriemisc/compounds/wwarmachineferz.gif [i] => ../alfaeriemisc/compounds/bwarmachineferz.gif [X] => welephantwazir.gif [x] => belephantwazir.gif ) [kpos] => g12 [Kpos] => g1 [wpr] => 4 [bpr] => 9 [fps] => 2 [pzs] => 4 [wprom] => Array ( [0] => L ) [bprom] => Array ( [0] => l ) [promotable] => Array ( [0] => a [1] => A [2] => b [3] => B [4] => m [5] => M [6] => r [7] => R [8] => e [9] => E [10] => i [11] => I [12] => g [13] => G [14] => z [15] => Z [16] => s [17] => S [18] => x [19] => X [20] => c [21] => C [22] => n [23] => N ) [Kirin-Desc] => The %s moves as a Ferz or Dabbabah, stepping once diagonally or leaping two squares straight, in any direction. [Phoenix-Desc] => The %s moves as a Wazir or Alfil, stepping once straight or leaping two squares diagonally, in any direction. [Black_Drunk_Elephant-Desc] => The %s moves as a King, except it cannot move straight backwards. [White_Drunk_Elephant-Desc] => The %s moves as a King, except it cannot move straight backwards. [Black_Copper_General-Desc] => The %s steps in any of the three forward directions or straight backwards. [White_Copper_General-Desc] => The %s steps in any of the three forward directions or straight backwards. [Bombard-Desc] => The %s is the Cannon from Janggi. It moves like the Rook, only it must jump over exactly one other piece, whether moving or capturing. [Arbalest-Desc] => The %s is to the Bombard what the Bishop is to the Rook. It moves like the Bishop, only it must jump over exactly one other piece, whether moving or capturing. [Condor-Desc] => The %s is derived from the Gryphon. It first moves as the Alfil, and then continues by sliding outward as a Rook. [Rhinoceros-Desc] => TThe %s (Unicorn) is also from Grant Acedrex. It leaps as a Knight and then slides outward as a Bishop. [Osprey-Desc] => The %s may jump to the second square on the same rank or file, and so long as it is unblocked, it may continue its move in an outward diagonal direction. [cap] => Array ( ) [posvar] => bdluzoqkozuldrmnbayyabnmrxiegsccsgeixpppppppppppp48PPPPPPPPPPPPXIEGSCCSGEIXRMNBAYYABNMRDLUZOQKOZULD,g1,g12 [free] => Lambda Object ( [stack] => Array ( [0] => haslower [1] => #0 [2] => or [3] => not [4] => hasupper [5] => #0 ) ) [pzone] => Lambda Object ( [stack] => Array ( [0] => not [1] => onboard [2] => where [3] => #0 [4] => 0 [5] => var [6] => pzs ) ) [af] => l1 [at] => j3 [ap] => X [p] => x ) ) )mline
Array ( [0] => MoveLine Object ( [movenum] => 0 [move] => [level] => 0 [comment] => [length] => 0 [newturn] => [turn] => 0 ) )allmoves
Array ( )movelist
constants
Array ( [p] => Black_Pawn [P] => White_Pawn [i] => Kirin [I] => Kirin [x] => Phoenix [X] => Phoenix [e] => Black_Drunk_Elephant [E] => White_Drunk_Elephant [g] => Black_Gold_General [G] => White_Gold_General [s] => Black_Silver_General [S] => White_Silver_General [c] => Black_Copper_General [C] => White_Copper_General [r] => Rook [R] => Rook [m] => Bombard [M] => Bombard [n] => Knight [N] => Knight [b] => Bishop [B] => Bishop [a] => Arbalest [A] => Arbalest [y] => Griffon [Y] => Griffon [d] => Condor [D] => Condor [l] => Lion [L] => Lion [u] => Rhinoceros [U] => Rhinoceros [z] => Zebra [Z] => Zebra [o] => Osprey [O] => Osprey [q] => Queen [Q] => Queen [K] => King [k] => King )