Please report any bugs or errors to Fergus Duniho or Aurelian Florea
Syntax Error on line 137
The + operator requires at least two arguments.
Edit the Settings File for Apothecary Chess-Modern
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 if == thismove null 1 say This preset enforces the rules and displays legal moves. 2 endif 3 echo Please report any bugs or errors to Fergus Duniho or Aurelian Florea 4 set kpos findpiece k spaces 5 set Kpos findpiece K spaces 6 setflag f2 f9 7 set ep false 8 def None == #0 #1 and != #0 #1 9 def None-Range (()()) 10 set last_type_moved None 11 def White_Barren_Pawn checkaleap #0 #1 0 1 and cond empty #0 not capture empty #1 or and or checkaleap #0 #1 -1 1 checkaleap #0 #1 1 1 cond empty #0 capture islower space #1 12 def White_Barren_Pawn-Range merge leaps #0 1 0 leaps #0 1 1 13 def Black_Barren_Pawn checkaleap #0 #1 0 -1 and cond empty #0 not capture empty #1 or and or checkaleap #0 #1 -1 -1 checkaleap #0 #1 1 -1 cond empty #0 capture isupper space #1 14 def Black_Barren_Pawn-Range merge leaps #0 1 0 leaps #0 1 1 15 def Sangoma checkleap #0 #1 2 3 or fn Bishop #0 #1 16 def Sangoma-Range merge leaps #0 2 3 rays #0 1 1 17 set Sangoma-desc "The %s Shaman has the powers of Bishop and Zebra" 18 include fairychess 19 allow drops 2 20 setsystem maxmove 2 21 copyfn Aanca Griffin 22 copyfn Aanca-Range Griffin-Range 23 set Aanca-Desc var Griffin-Desc 24 copyfn Griffon Dragon 25 copyfn Griffon-Range Dragon-Range 26 set Griffon-Desc var Dragon-Desc 27 def ACMKnight checkleap #0 #1 3 0 or checkleap #0 #1 2 2 and cond empty #0 not capture empty #1 or checkleap #0 #1 2 1 28 def ACMKnight-Range merge merge leaps #0 3 0 leaps #0 2 2 leaps #0 2 1 29 set ACMKnight-Desc "The %s Knight besides it's regular move may jump 3 squares orthogonally or 2 diagonally" 30 def Apothecary_King checkleap #0 #1 1 3 or checkleap #0 #1 1 2 and not sub checked #0 and match rankname #1 1 10 and flag #0 or checkleap #0 #1 1 0 or checkleap #0 #1 1 1 31 def Apothecary_King-Range merge merge leaps #0 1 0 leaps #0 1 1 merge leaps #0 1 2 leaps #0 1 3 32 set King-Desc "The %s King moves 1 square as a regular king but once in a game may jump the row behind 2 or 3 spaces away" 33 alias King Apothecary_King 34 sub Apothecary_King from to 35 if checkleap #from #to 1 1 or checkleap #from #to 1 0 36 return true 37 endif 38 move #to #from 39 if checkleap #from #to 1 3 or checkleap #from #to 1 2 and match rankname #to 1 10 and flag #from 40 if sub checked #from 41 die You may not perform the special moves out of check. 42 endif 43 move #from #to 44 return true 45 endif 46 endsub 47 def White_Joker fn str_replace "Black_" "White_" var last_type_moved #0 #1 48 def Black_Joker fn str_replace "White_" "Black_" var last_type_moved #0 #1 49 def White_Joker-Range fn join str_replace "Black_" "White_" var last_type_moved "-Range" #0 50 def Black_Joker-Range fn join str_replace "White_" "Black_" var last_type_moved "-Range" #0 51 setconst d Dragon 52 setconst D Dragon 53 setconst g Griffin 54 setconst G Griffin 55 setconst c Champion 56 setconst C Champion 57 setconst W Wizard 58 setconst w Wizard 59 setconst N ACMKnight 60 setconst n ACMKnight 61 setconst p Black_Pawn 62 setconst P White_Pawn 63 setconst q Queen 64 setconst Q Queen 65 setconst r Rook 66 setconst R Rook 67 setconst b Bishop 68 setconst B Bishop 69 setconst k Apothecary_King 70 setconst K Apothecary_King 71 alias Pawn White_Pawn 72 alias Pawn Black_Pawn 73 setconst j Black_Joker 74 setconst J White_Joker 75 setconst z Sangoma 76 setconst Z Sangoma 77 set pzs 3 78 set wpr 3 79 set bpr 8 80 set fps 2 81 set wcastle false 82 set bcastle false 83 set lastpiece p 84 if isconst position 85 setsystem space @position 86 else 87 empty b2 c2 d2 e2 g2 h2 i2 b9 c9 d9 e9 g9 h9 i9 88 set coin1 rand 0 1 89 set coin2 rand 0 1 90 if == coin2 0 91 drop Q any b2 e2 i2 92 drop G any b2 e2 i2 93 drop D any b2 e2 i2 94 copy b2 b9 95 copy e2 e9 96 copy i2 i9 97 flip b9 e9 i9 98 else 99 drop Q any d2 e2 g2 100 drop G any d2 e2 g2 101 drop D any d2 e2 g2 102 copy d2 d9 103 copy e2 e9 104 copy f2 f9 105 copy g2 g9 106 flip d9 e9 f9 g9 107 endif 108 if == coin1 0 109 drop N last b2 c2 d2 110 drop N first g2 h2 i2 111 drop n last b9 c9 d9 112 drop n first g9 h9 i9 113 drop B last b2 c2 d2 114 drop B first g2 h2 i2 115 drop b last b9 c9 d9 116 drop b first g9 h9 i9 117 else 118 drop B last b2 c2 d2 119 drop B first g2 h2 i2 120 drop b last b9 c9 d9 121 drop b first g9 h9 i9 122 drop N last b2 c2 d2 123 drop N first g2 h2 i2 124 drop n last b9 c9 d9 125 drop n first g9 h9 i9 126 endif 127 endif 128 set op system originalpieces 129 setelem op Q + elem Q op 1 130 setelem op q + elem q op 1 131 setelem op R + elem R op 1 132 setelem op r + elem r op 1 133 setelem op C + elem C op 1 134 setelem op c + elem c op 1 135 setelem op N + elem N op 1 136 setelem op n + elem n op 1 137 setelem op Z + elem Z op1 138 setelem op z + elem z op1 139 setsystem originalpieces var op 140 set cap unique keys capturedpieces 141 sub postauto1 142 if not isconst alias $moved 143 die The piece moved is undefined. 144 elseif isupper $old 145 die You may not capture your own pieces. 146 elseif islower alias $moved 147 die You may not move one of your opponent's pieces. 148 endif 149 if != const alias $moved White_Pawn 150 set ep false 151 if != alias space $dest alias $moved 152 die You may not change the type of this piece. 153 elseif capture 154 set nopvc 0 155 else 156 inc nopvc 157 endif 158 elseif == rankname $dest 8 159 set wprom intersection var cap array B N C W 160 elseif == rankname $dest 9 161 set wprom intersection var cap array B N C W R J Z G 162 elseif == rankname $dest 10 163 set wprom intersection var cap array B N C W R J Z D G Q 164 else 165 set wprom "" 166 endif 167 set codename const alias $moved 168 if sub #codename $origin $dest and issub #codename 169 elseif fn #codename $origin $dest and isfunc #codename and not issub #codename 170 else 171 set name alias #codename 172 set errmsg list "You may not move your" #name "from" $origin "to" join $dest ".
" 173 set desc join #codename "-Desc" 174 set errmsg str_replace "_" " " join #errmsg str_replace "%s" #name var #desc 175 die #errmsg 176 endif 177 set posvar join "w" join fencode boardflags 178 inc #posvar 179 set cap unique keys capturedpieces 180 if == moved K 181 unsetflag f2 182 set Kpos $dest 183 endif 184 if sub checked var Kpos 185 die You may not move into check. 186 endif 187 if empty a0 188 delete a0 189 endif 190 if empty b0 191 delete b0 192 endif 193 if empty i0 194 delete i0 195 endif 196 if empty j0 197 delete j0 198 endif 199 if != const alias $moved White_Joker 200 if != const alias $moved White_Pawn 201 set last_type_moved const alias $moved 202 else 203 set last_type_moved Black_Barren_Pawn 204 endif 205 endif 206 endsub 207 sub postauto2 208 if not isconst alias $moved 209 die The piece alias $moved is undefined. 210 elseif islower $old 211 die You may not capture your own pieces. 212 elseif isupper alias $moved 213 die You may not move one of your opponent's pieces. 214 endif 215 if != const alias $moved Black_Pawn 216 set ep false 217 if != alias space $dest alias $moved 218 die You may not change the typpe of this piece. 219 elseif capture 220 set nopvc 0 221 else 222 inc nopvc 223 endif 224 elseif == rankname $dest 3 225 set bprom intersection var cap array b n c w 226 elseif == rankname $dest 2 227 set bprom intersection var cap array b n c w r j z g 228 elseif == rankname $dest 1 229 set bprom intersection var cap array b n c w r j z d g q 230 else 231 set wprom "" 232 endif 233 set codename const alias $moved 234 if sub #codename $origin $dest and issub #codename 235 elseif fn #codename $origin $dest and isfunc #codename and not issub #codename 236 else 237 set name alias #codename 238 set errmsg list "You may not move your" #name "from" $origin "to" join $dest ".
" 239 set desc join #codename "-Desc" 240 set errmsg str_replace "_" " " join #errmsg str_replace "%s" #name var #desc 241 die #errmsg 242 endif 243 set posvar join "b" join fencode boardflags 244 inc #posvar 245 set cap unique keys capturedpieces 246 if == moved k 247 unsetflag f9 248 set kpos $dest 249 endif 250 if sub checked var kpos 251 die You may not move into check. 252 endif 253 if empty a11 254 delete a11 255 endif 256 if empty b11 257 delete b11 258 endif 259 if empty i11 260 delete i11 261 endif 262 if empty j11 263 delete j11 264 endif 265 if != const alias $moved Black_Joker 266 if != const alias $moved Black_Pawn 267 set last_type_moved const alias $moved 268 else 269 set last_type_moved White_Barren_Pawn 270 endif 271 endif 272 endsub 273 moveindex 0 274 MOVE: P e3-e5 275 postauto1 276 moveindex 1 277 MOVE: p e8-e6 278 postauto2 279 moveindex 2 280 MOVE: P f3-f4 281 postauto1 282 moveindex 3 283 MOVE: d d9-e8 284 postauto2 285 moveindex 4 286 MOVE: P h3-h4 287 postauto1 288 moveindex 5 289 MOVE: p h8-h7 290 postauto2 291 moveindex 6 292 MOVE: B i2-e6 293 postauto1 294 moveindex 7 295 MOVE: p f8-f7 296 postauto2 297 moveindex 8 298 MOVE: B e6-h3 299 postauto1 300 moveindex 9 301 MOVE: w g11-f8 302 postauto2 303 moveindex 10 304 MOVE: J f0-e3 305 postauto1 306 moveindex 11 307 MOVE: n c9-b7 308 postauto2 309 moveindex 12 310 MOVE: W g0-f3 311 postauto1 312 moveindex 13 313 MOVE: p d8-d6 314 postauto2 315 moveindex 14 316 MOVE: P c3-c4 317 postauto1 318 moveindex 15 319 MOVE: p d6-e5 320 postauto2 321 moveindex 16 322 MOVE: B b2-e5 323 postauto1 324 moveindex 17 325 MOVE: b i9-e5 326 postauto2 327 moveindex 18 328 MOVE: P f4-e5 329 postauto1 330 moveindex 19 331 MOVE: w f8-e5 332 postauto2 333 moveindex 20 334 MOVE: resign 335 postauto1 336 set posvar join "w" join fencode boardflags 337 if >= var #posvar 3 338 say Three Times Repetition! Drawn Game! 339 drawn 340 elseif sub stalemated var kpos 341 if sub checked var kpos 342 say Checkmate! White has won! 343 won 344 else 345 say Stalemate! The game is drawn. 346 drawn 347 endif 348 elseif >= #nopvc 100 349 say One Hundred Moves Without Moving a Pawn or Capturing! Game Drawn! 350 drawn 351 elseif sub checked var kpos 352 say Check! 353 endif 354 end 355 end 356 357 lib fairychess 358 if flag use-chess-defaults 359 setconst k King 360 setconst K King 361 setconst q Queen 362 setconst Q Queen 363 setconst r Rook 364 setconst R Rook 365 setconst b Bishop 366 setconst B Bishop 367 setconst n Knight 368 setconst N Knight 369 setconst p Black_Pawn 370 setconst P White_Pawn 371 endif 372 if flag use-chess-defaults 373 set wpr 2 374 set bpr 7 375 set fps 2 376 set pzs 1 377 set wcastle c1 g1 378 set bcastle c8 g8 379 set wprom Q R B N 380 set bprom q r b n 381 set promotable p P 382 elseif not isset wpr 383 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 384 elseif not isset bpr 385 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 386 elseif not isset fps 387 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 388 elseif not isset pzs 389 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 390 elseif not isset wcastle 391 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 392 elseif not isset bcastle 393 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 394 elseif not isset wprom 395 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 396 elseif not isset bprom 397 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 398 endif 399 set ep false 400 setsystem maxmove 2 401 ban commands allmoves 402 allow moves 1 captures 1 promotions 2 403 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." 404 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 405 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 406 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." 407 def Amazon fn Bishop #0 #1 or fn Rook #0 #1 or fn Knight #0 #1 408 def Amazon-Range merge leaps # 1 2 merge rays #0 1 0 rays #0 1 1 409 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." 410 def Bede checkride #0 #1 1 1 or checkleap #0 #1 0 2 411 def Bede-Range merge rays #0 1 1 leaps #0 0 2 412 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 413 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 414 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 415 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 416 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." 417 set Black_Berolina_Pawn-Desc var White_Berolina_Pawn-Desc 418 sub White_Berolina_Pawn from to 419 verify > rank #to rank #from 420 verify <= distance #to #from #fps 421 if capture 422 verify checkleap #from #to 1 0 423 set epp false 424 set epc false 425 elseif checkleap #from #to 1 0 and == #to #epp 426 capture #epc 427 set epp false 428 set epc false 429 elseif > distance #to #from 1 430 verify == rankname #from #wpr 431 verify checkride #from #to 1 1 432 set epp elem 0 path #from #to 433 set epc #to 434 else 435 verify checkleap #from #to 1 1 436 set epp false 437 set epc false 438 endif 439 if onboard where #to 0 #pzs 440 if != space #to $moved 441 set name alias const alias $moved 442 die "You may not promote a" #name "until it reaches the promotion zone." 443 endif 444 elseif onboard where #to 0 1 445 if == White_Berolina_Pawn const alias space #to and count var wprom 446 if not $answered and == mln $maxmln 447 push wprom space #to 448 askpromote #wprom 449 endif 450 elseif not match space #to var wprom and != White_Pawn const alias space #to 451 set name alias const alias $moved 452 set newname alias const alias space #to 453 set msg list "You may not promote your" #name "to a" join #newname ".
" 454 set msg str_replace "_" " " var msg 455 die #msg 456 endif 457 elseif count var wprom 458 if == White_Berolina_Pawn const alias space #to 459 if == count var wprom 1 460 set newpiece join list var wprom 461 set newmove join #newpiece "-dest" 462 add #newpiece $dest 463 appendmove #newmove 464 else 465 askpromote #wprom 466 endif 467 elseif not match space #to var wprom 468 set name alias const alias $moved 469 set newname alias const alias space #to 470 set msg list "You may not promote your" #name "to a" join #newname ".
" 471 set msg str_replace "_" " " var msg 472 die #msg 473 endif 474 else 475 set name alias const alias $moved 476 set msg list "You may not advance your" #name "to the last rank, because there is nothing you may promote it to." 477 set msg str_replace "_" " " var msg 478 die #msg 479 endif 480 set nopvc 0 481 return true 482 endsub 483 sub Black_Berolina_Pawn from to 484 verify < rank #to rank #from 485 verify <= distance #to #from #fps 486 if capture 487 verify checkleap #from #to 1 0 488 set epp false 489 set epc false 490 elseif checkleap #from #to 1 0 and == #to #epp 491 capture #epc 492 set epp false 493 set epc false 494 elseif > distance #to #from 1 495 verify == rankname #from #bpr 496 verify checkride #from #to 1 1 497 set epp elem 0 path #from #to 498 set epc #to 499 else 500 verify checkleap #from #to 1 1 501 set epp false 502 set epc false 503 endif 504 if onboard where #to 0 neg #pzs 505 if != space #to $moved 506 set name alias const alias $moved 507 die "You may not promote a" #name "until it reaches the promotion zone." 508 endif 509 elseif onboard where #to 0 -1 510 if == Black_Berolina_Pawn const alias space #to and count var bprom 511 if not $answered and == mln $maxmln 512 push bprom space #to 513 askpromote #bprom 514 endif 515 elseif not match space #to var bprom and != Black_Pawn const alias space #to 516 set name alias const alias $moved 517 set newname alias const alias space #to 518 set msg list "You may not promote your" #name "to a" join #newname ".
" 519 set msg str_replace "_" " " var msg 520 die #msg 521 endif 522 elseif count var bprom 523 if == Black_Berolina_Pawn const alias space #to 524 if == count var bprom 1 525 set newpiece join list var bprom 526 set newmove join #newpiece "-dest" 527 add #newpiece $dest 528 appendmove #newmove 529 else 530 askpromote #bprom 531 endif 532 elseif not match space #to var bprom 533 set name alias const alias $moved 534 set newname alias const alias space #to 535 set msg list "You may not promote your" #name "to a" join #newname ".
" 536 set msg str_replace "_" " " var msg 537 die #msg 538 endif 539 else 540 set name alias const alias $moved 541 set msg list "You may not advance your" #name "to the last rank, because there is nothing you may promote it to." 542 set msg str_replace "_" " " var msg 543 die #msg 544 endif 545 set nopvc 0 546 return true 547 endsub 548 def Bishop checkride #0 #1 1 1 549 def Bishop-Range rays #0 1 1 550 set Bishop-Desc "The %s may move diagonally any number of spaces until it reaches an occupied space." 551 def Cannon cond cond empty #0 capture (not empty #1) (checkhop #0 #1 0 1) (checkride #0 #1 0 1) and #1 552 def Cannon-Range rays #0 1 0 553 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." 554 def Camel checkleap #0 #1 1 3 555 def Camel-Range leaps #0 1 3 556 set Camel-Desc "The %s leaps to any space at the opposite corner of a 1x3 rectangle." 557 def Camelrider checkride #0 #1 1 3 558 def Camelrider-Range rays #0 1 3 559 set Camelrider-Desc "The %s may make any number of Camel moves in the same direction until it lands on an occupied space." 560 def Cardinal fn Bishop #0 #1 or fn Knight #0 #1 561 def Cardinal-Range merge leaps #0 1 2 rays #0 1 1 562 set Cardinal-Desc "The %s may move along diagonals as a Bishop or leap as a Knight." 563 def Centaur checkleap #0 #1 1 1 or checkleap #0 #1 1 0 or checkleap #0 #1 1 2 564 def Centaur-Range merge leaps #0 1 2 merge leaps #0 1 0 leaps #0 1 1 565 set Centaur-Desc "The %s may move to any adjacent space as a King or leap like a Knight." 566 def Champion fn Elephant #0 #1 or fn Dabbabah #0 #1 or fn Wazir #0 #1 567 def Champion-Range mergeall leaps #0 2 2 leaps #0 2 0 leaps #0 1 0 568 set Champion-Desc "The %s may leap one or two spaces orthogonally or two spaces diagonally." 569 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) 570 def White_Charging_Knight-Range mergeall leaps #0 1 2 leaps #0 1 1 leaps #0 1 0 571 set White_Charging_Knight-Desc "The %s may leap forward as a Knight or move one space sideways or backwards like a King." 572 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) 573 def Black_Charging_Knight-Range mergeall leaps #0 1 2 leaps #0 1 1 leaps #0 1 0 574 set Black_Charging_Knight-Desc "The %s may leap forward as a Knight or move one space sideways or backwards like a King." 575 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 576 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 577 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." 578 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 579 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 580 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." 581 def Chinese_Elephant checkpath #0 #1 1 1 1 1 582 def Chinese_Elephant-Range leaps #0 2 2 583 set Chinese_Elephant-Desc "The %s may move two spaces diagonally so long as the space in between is empty." 584 def White_Chinese_Elephant checkpath #0 #1 1 1 1 1 and < rank #1 + 1 / lastrank 2 585 def White_Chinese_Elephant-Range leaps #0 2 2 586 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." 587 def Black_Chinese_Elephant checkpath #0 #1 1 1 1 1 and >= rank #1 + 1 / lastrank 2 588 def Black_Chinese_Elephant-Range leaps #0 2 2 589 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." 590 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 591 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 592 def Chinese_General == distance #0 #1 1 or == var movetype CHECK and checkride #0 #1 1 0 and flag #1 593 def Chinese_General-Range leaps #0 1 0 594 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." 595 def Chinese_Guard checkleap #0 #1 1 1 and flag #1 596 def Chinese_Guard-Range leaps #0 1 1 597 set Chinese_Guard-Desc "The %s may move one space diagonally within the confines of the palace." 598 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 599 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 600 def White_Chinese_Pawn-Range leaps #0 1 0 601 def Black_Chinese_Pawn-Range leaps #0 1 0 602 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." 603 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." 604 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 605 def White_Colonel mergeall rays #0 1 0 leaps #0 1 2 leaps #0 1 1 606 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." 607 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 608 def Black_Colonel mergeall rays #0 1 0 leaps #0 1 2 leaps #0 1 1 609 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." 610 def Dabbabah checkleap #0 #1 0 2 611 def Dabbabah-Range leaps #0 0 2 612 set Dabbabah-Desc "The %s may leap two spaces vertically or horizontally." 613 def Dabbabahrider checkride #0 #1 0 2 614 def Dabbabahrider-Range rays #0 0 2 615 set Dabbabahrider-Desc "The %s may make any number of two space orthogonal leaps in the same direction until it reaches an occupied space." 616 def Dragon_Horse checkride #0 #1 1 1 or checkleap #0 #1 1 0 617 def Dragon_Horse-Range merge leaps #0 1 0 rays #0 1 1 618 set Dragon_Horse-Desc "The %s may move along diagonals as a Bishop or move one space orthogonally as a Wazir." 619 def Dragon_King checkride #0 #1 1 0 or checkleap #0 #1 1 1 620 def Dragon_King-Range merge leaps #0 1 1 rays #0 1 0 621 set Dragon_King-Desc "The %s may move along its rank or file as a Rook or one space diagonally as a Ferz." 622 def Elephant checkleap #0 #1 2 2 623 def Elephant-Range leaps #0 2 2 624 set Elephant-Desc "The %s may leap two spaces in any diagonal direction." 625 def Elephantrider checkride #0 #1 2 2 626 def Elephantrider-Range rays #0 2 2 627 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." 628 def Eques_Rex checkleap #0 #1 1 1 or checkleap #0 #1 1 0 or checkleap #0 #1 1 2 629 def Eques_Rex-Range merge leaps #0 1 2 merge leaps #0 1 0 leaps #0 1 1 630 set Eques_Rex-Desc "The %s may move to any adjacent space as a King or leap like a Knight." 631 def Fad checkleap #0 #1 1 1 or checkleap #0 #1 2 2 or checkleap #0 #1 2 0 632 def Fad-Range mergeall leaps #0 1 1 leaps #0 2 2 leaps #0 2 0 633 set Fad-Desc "The %s may move one space diagonally, or it may leap two spaces diagonally or orthogonally." 634 def Ferz checkleap #0 #1 1 1 635 def Ferz-Range leaps #0 1 1 636 set Ferz-Desc "The %s may move one space diagonally." 637 def Fibnif checkleap #0 #1 1 2 or checkleap #0 #1 1 1 and == 1 abs - file #0 file #1 638 def Fibnif-Range merge leaps #0 1 2 leaps #0 1 1 639 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." 640 def Giraffe checkleap #0 #1 1 4 641 def Giraffe-Range leaps #0 1 4 642 set Giraffe-Desc "The %s may leap to any space that is one file and four ranks or one rank and four files away." 643 def White_Gold_General checkaleap #0 #1 1 1 or checkaleap #0 #1 -1 1 or checkleap #0 #1 0 1 644 def White_Gold_General-Range mergeall leaps #0 1 0 where #0 1 1 where #0 -1 1 645 set White_Gold_General-Desc "The %s may move one space in any orthgonal direction or one space diagonally forward." 646 def Black_Gold_General checkaleap #0 #1 1 -1 or checkaleap #0 #1 -1 -1 or checkleap #0 #1 0 1 647 def Black_Gold_General-Range mergeall leaps #0 1 0 where #0 1 -1 where #0 -1 -1 648 set Black_Gold_General-Desc "The %s may move one space in any orthgonal direction or one space diagonally forward." 649 def Grasshopper checkgrasshop #0 #1 1 1 or checkgrasshop #0 #1 1 0 650 def Grasshopper-Range merge rays #0 1 0 rays #0 1 1 651 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." 652 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 653 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 654 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." 655 def King checkleap #0 #1 1 1 or checkleap #0 #1 1 0 656 def King-Range merge leaps #0 1 0 leaps #0 1 1 657 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." 658 sub King from to 659 if not fn King #from #to 660 verify sub castle #from #to and match #to var cond isupper space #to wcastle bcastle 661 endif 662 if isupper space #to 663 set Kpos #to 664 else 665 set kpos #to 666 endif 667 return true 668 endsub 669 def Knight checkleap #0 #1 1 2 670 def Knight-Range leaps #0 1 2 671 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." 672 def Korean_Elephant checkpath #0 #1 1 0 1 1 1 1 673 def Korean_Elephant-Range leaps #0 2 3 674 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." 675 def White_Lance checkaride #0 #1 0 1 676 def White_Lance-Range ray #0 0 1 677 set "The %s may move forward in its file as a Rook." 678 def Black_Lance checkaride #0 #1 0 -1 679 def Black_Lance-Range ray #0 0 -1 680 set "The %s may move forward in its file as a Rook." 681 def Leo fn Vao #0 #1 or fn Cannon #0 #1 682 def Leo-Range merge rays #0 1 0 rays #0 1 1 683 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." 684 def Mao checktwostep #0 #1 0 1 1 1 685 def Mao-Range leaps #0 1 2 686 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." 687 def Marshall fn Knight #0 #1 or fn Rook #0 #1 688 def Marshall-Range merge rays #0 1 0 leaps #0 1 2 689 set Marshall-Desc "The %s moves orthogonally as a Rook or leaps as a Knight." 690 def Moa checktwostep #0 #1 1 1 0 1 691 def Moa-Range leaps #0 1 2 692 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." 693 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 694 def Murray_Lion-Range merge merge leaps #0 2 0 leaps #0 2 2 merge leaps #0 1 0 leaps #0 1 1 695 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." 696 def Nightrider checkride #0 #1 1 2 697 def Nightrider-Range rays #0 1 2 698 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." 699 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." 700 set Black_Pawn-Desc var White_Pawn-Desc 701 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 702 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 703 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 704 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 705 def White_Pawn-Promote var wprom 706 def Black_Pawn-Promote var bprom 707 sub White_Pawn from to 708 my newpiece 709 my newmove 710 my prom 711 verify > rank #to rank #from 712 verify <= distance #to #from #fps 713 if capture 714 verify checkleap #from #to 1 1 715 set ep false 716 elseif checkleap #from #to 1 1 and #ep 717 verify == filename var ep filename #to 718 verify < rankname var ep rankname #to 719 verify < rankname #to var bpr 720 capture #ep 721 set ep false 722 elseif > distance #to #from 1 723 verify == rankname #from #wpr 724 verify checkride #from #to 0 1 725 set ep #to 726 else 727 verify checkleap #from #to 0 1 728 set ep false 729 endif 730 set prom fn White_Pawn-Promote #to 731 if onboard where #to 0 #pzs 732 if != space #to $moved 733 set name alias const alias $moved 734 die "You may not promote a" #name "until it reaches the promotion zone." 735 endif 736 elseif onboard where #to 0 1 737 if == White_Pawn const alias space #to and count var prom 738 if not $answered and == mln $maxmln and not strstr thismove chr 59 739 if not match alias space #to var prom 740 push prom space #to 741 endif 742 askpromote #prom 743 endif 744 elseif not match space #to var prom and != White_Pawn const alias space #to 745 set name alias const alias $moved 746 set newname alias const alias space #to 747 set msg list "You may not promote your" #name "to a" join #newname ".
" 748 set msg str_replace "_" " " var msg 749 die #msg 750 endif 751 elseif count var prom 752 if == White_Pawn const alias space #to 753 if == count var prom 1 754 set newpiece alias list var prom 755 set pieceid realname #newpiece 756 set newmove join #newpiece "-dest" 757 add #pieceid $dest 758 appendmove #newmove 759 else 760 askpromote #prom 761 endif 762 elseif not match alias space #to var prom 763 set name alias const alias $moved 764 set newname alias const alias space #to 765 set msg list "You may not promote your" #name "to a" join #newname ".
" 766 set msg str_replace "_" " " var msg 767 die #msg 768 endif 769 else 770 set name alias const alias $moved 771 set msg list "You may not advance your" #name "to the last rank, because there is nothing you may promote it to." 772 set msg str_replace "_" " " var msg 773 die #msg 774 endif 775 set nopvc 0 776 return true 777 endsub 778 sub Black_Pawn from to 779 my newpiece, pieceid 780 my newmove 781 my prom 782 verify < rank #to rank #from 783 verify <= distance #to #from #fps 784 if capture 785 verify checkleap #from #to 1 1 786 set ep false 787 elseif checkleap #from #to 1 1 and #ep 788 verify == filename var ep filename #to 789 verify > rankname var ep rankname #to 790 verify > rankname #to var wpr 791 capture #ep 792 set ep false 793 elseif > distance #to #from 1 794 verify == rankname #from #bpr 795 verify checkride #from #to 0 1 796 set ep #to 797 else 798 verify checkleap #from #to 0 1 799 set ep false 800 endif 801 set prom fn Black_Pawn-Promote #to 802 if onboard where #to 0 neg #pzs 803 if != space #to $moved 804 set name alias const alias $moved 805 die "You may not promote a" #name "until it reaches the promotion zone." 806 endif 807 elseif onboard where #to 0 -1 808 if == Black_Pawn const alias space #to and count var prom 809 if not $answered and == mln $maxmln and not strstr thismove chr 59 810 push prom space #to 811 askpromote #prom 812 endif 813 elseif not match space #to var prom and != Black_Pawn const alias space #to 814 set name alias const alias $moved 815 set newname alias const alias space #to 816 set msg list "You may not promote your" #name "to a" join #newname ".
" 817 set msg str_replace "_" " " var msg 818 die #msg 819 endif 820 elseif count var prom 821 if == Black_Pawn const alias space #to 822 if == count var prom 1 823 set newpiece alias list var prom 824 set newmove join #newpiece "-dest" 825 set pieceid realname var newpiece 826 add #pieceid $dest 827 appendmove #newmove 828 else 829 askpromote #prom 830 endif 831 elseif not match alias space #to var prom 832 set name alias const alias $moved 833 set newname alias const alias space #to 834 set msg list "You may not promote your" #name "to a" join #newname ".
" 835 set msg str_replace "_" " " var msg 836 die #msg 837 endif 838 else 839 set name alias const alias $moved 840 set msg list "You may not advance your" #name "to the last rank, because there is nothing you may promote it to." 841 set msg str_replace "_" " " var msg 842 die #msg 843 endif 844 set nopvc 0 845 return true 846 endsub 847 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." 848 set Black_Quick_Pawn-Desc var White_Quick_Pawn-Desc 849 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 850 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 851 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 852 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 853 def White_Quick_Pawn-Promote var wprom 854 def Black_Quick_Pawn-Promote var bprom 855 sub White_Quick_Pawn from to 856 my newpiece 857 my newmove 858 my prom 859 verify > rank #to rank #from 860 verify <= distance #to #from #fps 861 if capture 862 verify checkleap #from #to 1 1 863 set epf false 864 set ep false 865 elseif checkleap #from #to 1 1 and #ep 866 verify == filename var ep filename #to 867 verify < rankname var ep rankname #to 868 verify < rankname #to rankname var epf 869 capture #ep 870 set epf false 871 set ep false 872 elseif > distance #to #from 1 873 verify checkride #from #to 0 1 874 set epf #from 875 set ep #to 876 else 877 verify checkleap #from #to 0 1 878 set epf false 879 set ep false 880 endif 881 set prom fn White_Quick_Pawn-Promote #to 882 if onboard where #to 0 #pzs 883 if != space #to $moved 884 set name alias const alias $moved 885 die "You may not promote a" #name "from" $moved "to" {space #to} "until it reaches the promotion zone." 886 endif 887 elseif onboard where #to 0 1 888 if == White_Quick_Pawn const alias space #to and count var prom 889 if not $answered and == mln $maxmln and not strstr thismove chr 59 890 if not match alias space #to var prom 891 push prom space #to 892 endif 893 askpromote #prom 894 endif 895 elseif not match space #to var prom and != White_Quick_Pawn const alias space #to 896 set name alias const alias $moved 897 set newname alias const alias space #to 898 set msg list "You may not promote your" #name "to a" join #newname ".
" 899 set msg str_replace "_" " " var msg 900 die #msg 901 endif 902 elseif count var prom 903 if == White_Quick_Pawn const alias space #to 904 if == count var prom 1 905 set newpiece alias list var prom 906 set pieceid realname #newpiece 907 set newmove join #newpiece "-dest" 908 add #pieceid $dest 909 appendmove #newmove 910 else 911 askpromote #prom 912 endif 913 elseif not match alias space #to var prom 914 set name alias const alias $moved 915 set newname alias const alias space #to 916 set msg list "You may not promote your" #name "to a" join #newname ".
" 917 set msg str_replace "_" " " var msg 918 die #msg 919 endif 920 else 921 set name alias const alias $moved 922 set msg list "You may not advance your" #name "to the last rank, because there is nothing you may promote it to." 923 set msg str_replace "_" " " var msg 924 die #msg 925 endif 926 set nopvc 0 927 return true 928 endsub 929 sub Black_Quick_Pawn from to 930 my newpiece, pieceid 931 my newmove 932 my prom 933 verify < rank #to rank #from 934 verify <= distance #to #from #fps 935 if capture 936 verify checkleap #from #to 1 1 937 set ep false 938 set epf false 939 elseif checkleap #from #to 1 1 and #ep 940 verify == filename var ep filename #to 941 verify > rankname var ep rankname #to 942 verify > rankname #to rankname var epf 943 capture #ep 944 set ep false 945 set epf false 946 elseif > distance #to #from 1 947 verify checkride #from #to 0 1 948 set ep #to 949 set epf #from 950 else 951 verify checkleap #from #to 0 1 952 set ep false 953 set epf false 954 endif 955 set prom fn Black_Quick_Pawn-Promote #to 956 if onboard where #to 0 neg #pzs 957 if != space #to $moved 958 set name alias const alias $moved 959 die "You may not promote a" #name "until it reaches the promotion zone." 960 endif 961 elseif onboard where #to 0 -1 962 if == Black_Quick_Pawn const alias space #to and count var prom 963 if not $answered and == mln $maxmln and not strstr thismove chr 59 964 push prom space #to 965 askpromote #prom 966 endif 967 elseif not match space #to var prom and != Black_Quick_Pawn const alias space #to 968 set name alias const alias $moved 969 set newname alias const alias space #to 970 set msg list "You may not promote your" #name "to a" join #newname ".
" 971 set msg str_replace "_" " " var msg 972 die #msg 973 endif 974 elseif count var prom 975 if == Black_Quick_Pawn const alias space #to 976 if == count var prom 1 977 set newpiece alias list var prom 978 set newmove join #newpiece "-dest" 979 set pieceid realname var newpiece 980 add #pieceid $dest 981 appendmove #newmove 982 else 983 askpromote #prom 984 endif 985 elseif not match alias space #to var prom 986 set name alias const alias $moved 987 set newname alias const alias space #to 988 set msg list "You may not promote your" #name "to a" join #newname ".
" 989 set msg str_replace "_" " " var msg 990 die #msg 991 endif 992 else 993 set name alias const alias $moved 994 set msg list "You may not advance your" #name "to the last rank, because there is nothing you may promote it to." 995 set msg str_replace "_" " " var msg 996 die #msg 997 endif 998 set nopvc 0 999 return true 1000 endsub 1001 def Queen fn Bishop #0 #1 or fn Rook #0 #1 1002 def Queen-Range merge rays #0 1 0 rays #0 1 1 1003 set Queen-Desc "The %s may move as a Rook or a Bishop." 1004 def Rhino windingride #0 #1 1 0 1 1 or windingride #0 #1 0 1 1 1 1005 def Rhino-Range merge eval (windingrays #0 1 0 1 1) windingrays #0 0 1 1 1 1006 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." 1007 def Rook checkride #0 #1 1 0 1008 def Rook-Range rays #0 1 0 1009 set Rook-Desc "The %s may move any number of spaces in any vertical or horizontal direction until it reaches an occupied space." 1010 def Short_Rook checkride #0 #1 1 0 and <= distance #0 #1 4 1011 def Short_Rook-Range merge merge leaps #0 1 0 leaps #0 2 0 merge leaps #0 3 0 leaps #0 4 0 1012 set "The %s may move up to four spaces along its rank or file as a Rook." 1013 def White_Shogi_Knight checkaleap #0 #1 1 2 or checkaleap #0 #1 -1 2 1014 def White_Shogi_Knight-Range array where #0 1 2 where #0 -1 2 1015 set White_Shogi_Knight-Desc "The %s may leap to either space that is two ranks ahead and one file to the side." 1016 def Black_Shogi_Knight checkaleap #0 #1 1 -2 or checkaleap #0 #1 -1 -2 1017 def Black_Shogi_Knight-Range array where #0 1 -2 where #0 -1 -2 1018 set Black_Shogi_Knight-Desc "The %s may leap to either space that is two ranks ahead and one file to the side." 1019 def White_Shogi_Pawn checkaleap #0 #1 0 1 1020 def White_Shogi_Pawn-Range array where #0 0 1 1021 set White_Shogi_Pawn-Desc "The %s map move one space forward in the same file." 1022 def Black_Shogi_Pawn checkaleap #0 #1 0 -1 1023 def Black_Shogi_Pawn-Range array where #0 0 -1 1024 set Black_Shogi_Pawn-Desc "The %s map move one space forward in the same file." 1025 def White_Silver_General checkaleap #0 #1 0 1 or checkleap #0 #1 1 1 1026 def White_Silver_General-Range mergeall leaps #0 1 1 where #0 0 1 1027 set White_Silver_General-Desc "The %s may move one space in any diagonal direction or one space vertically foward." 1028 def Black_Silver_General checkaleap #0 #1 0 -1 or checkleap #0 #1 1 1 1029 def Black_Silver_General-Range mergeall leaps #0 1 1 where #0 0 -1 1030 set Black_Silver_General-Desc "The %s may move one space in any diagonal direction or one space vertically foward." 1031 def Squirrel fn Elephant #0 #1 or fn Dabbabah #0 #1 or fn Knight #0 #1 1032 def Squirrel-Range mergeall leaps #0 2 2 leaps #0 2 0 leaps #0 1 2 1033 set Squirrel-Desc "The %s may leap any non-adjacent space that is no more than two spaces away." 1034 def Spider fn Dabbabah #0 #1 or fn Elephant #0 #1 1035 def Spider-Range merge leaps #0 2 2 leaps #0 0 2 1036 set Spider-Desc "The %s may leap to any space that is two spaces away orthogonally or diagonally." 1037 def Spider-rider fn Dabbabahrider #0 #1 or fn Elephantrider #0 #1 1038 def Spider-rider-Range merge rays #0 2 2 rays #0 0 2 1039 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." 1040 def Squire checktwostep #0 #1 0 1 1 1 or checktwostep #0 #1 1 1 0 1 1041 def Squire-Range leaps #0 1 2 1042 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." 1043 def Unicorn fn Nightrider #0 #1 or fn Bishop #0 #1 1044 def Unicorn-Range merge rays #0 1 2 rays #0 1 1 1045 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." 1046 def Vao cond cond empty #0 capture (not empty #1) (checkhop #0 #1 1 1) (checkride #0 #1 1 1) and #1 1047 def Vao-Range rays #0 1 1 1048 set Vao-Desc "The %s may move diagonally as a Bishop, but it must hop over exactly one intervening piece when it captures." 1049 def Wazir checkleap #0 #1 1 0 1050 def Wazir-Range leaps #0 1 0 1051 set Wazir-Desc "The %s may move one space horizontally or vertically." 1052 def Wizard fn Ferz #0 #1 or fn Camel #0 #1 1053 def Wizard-Range merge leaps #0 1 1 leaps #0 1 3 1054 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." 1055 def Woody_Rook checkleap #0 #1 0 2 or checkleap #0 #1 0 1 1056 def Woody_Rook-Range merge leaps #0 0 1 leaps #0 0 2 1057 set Woody_Rook-Desc "The %s may leap one or two spaces orthogonally. It may pass over another piece when moving two spaces." 1058 def Zebra checkleap #0 #1 2 3 1059 def Zebra-Range leaps #0 2 3 1060 set Zebra-Desc "The %s may leap to any space that is 2 ranks and 3 files or 2 files and 3 ranks away." 1061 def Elephant_Ferz fn Ferz #0 #1 or fn Elephant #0 #1 1062 def Elephant_Ferz-Range merge leaps #0 2 2 leaps #0 1 1 1063 set Elephant_Ferz-Desc "The %s may leap one or two spaces diagonally. It may pass over another piece when moving two spaces." 1064 def Elephant_Wazir fn Wazir #0 #1 or fn Elephant #0 #1 1065 def Elephant_Wazir-Range merge leaps #0 2 2 leaps #0 1 0 1066 set Elephant_Wazir-Desc "The %s may move one space orthogonally, as a Wazir, or leap two spaces diagonally, as an Elephant." 1067 def Kylin fn Ferz #0 #1 or fn Dabbabah #0 #1 1068 def Kylin-Range mergeall leaps #0 1 1 leaps #0 2 0 1069 set Kylin-Desc "The %s may move one space diagonally, or it may leap 2 spaces orthogonally, passing over any pieces in the way." 1070 def Half_Duck fn Ferz #0 #1 or fn Dabbabah #0 #1 or checkleap #0 #1 3 0 1071 def Half_Duck-Range mergeall leaps #0 1 1 leaps #0 2 0 leaps #0 3 0 1072 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." 1073 def Knight_Wazir fn Knight #0 #1 or fn Wazir #0 #1 1074 def Knight_Wazir-Range merge leaps #0 1 2 leaps #0 1 0 1075 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." 1076 def Frog fn Ferz #0 #1 or checkleap #0 #1 3 0 1077 def Frog-Range merge leaps #0 1 1 leaps #0 3 0 1078 set Frog-Desc "The %s may move one space diagonally or directly leap 3 spaces orthogonally." 1079 def Buffalo fn Knight #0 #1 or fn Camel #0 #1 or fn Zebra #0 #1 1080 def Buffalo-Range mergeall leaps #0 1 2 leaps #0 1 3 leaps #0 2 3 1081 set Buffalo-Desc "The %s Buffalo may leap (1, 2) as a Knight, (1, 3) as a Camel, or (2, 3) as a Zebra." 1082 def @ false 1083 sub attacked start finish 1084 my from piece actual 1085 local movetype 1086 set movetype MOVE 1087 if empty #start 1088 set actual true 1089 move #finish #start 1090 add $old #finish 1091 endif 1092 if isupper space #start 1093 def enemies onlylower 1094 else 1095 def enemies onlyupper 1096 endif 1097 for (from piece) fn enemies 1098 if fn const alias #piece #from #to 1099 if #actual 1100 move #start #finish 1101 endif 1102 return #from 1103 endif 1104 next 1105 if #actual 1106 move #start #finish 1107 endif 1108 return false 1109 endsub 1110 sub fission-attacked start finish 1111 my from piece p1 p2 1112 local movetype 1113 set p1 space #start 1114 set p2 space #finish 1115 set movetype CHECK 1116 if isupper #p1 1117 def enemies onlylower 1118 else 1119 def enemies onlyupper 1120 endif 1121 empty #finish 1122 for (from piece) fn enemies 1123 if fn const alias #piece #from #start 1124 add #p2 #finish 1125 return #from 1126 endif 1127 next 1128 add #p2 #finish 1129 return false 1130 endsub 1131 sub checked king 1132 my from piece 1133 local movetype 1134 set movetype CHECK 1135 if isupper cond empty var king $moved space var king 1136 def enemies onlylower 1137 else 1138 def enemies onlyupper 1139 endif 1140 for (from piece) fn enemies 1141 if fn const alias #piece #from var king and isfunc const alias #piece 1142 return #from 1143 endif 1144 next 1145 return false 1146 endsub 1147 def checked anytrue lambda (fn const alias #0 var key var king) cond isupper space var king (onlylower) (onlyupper) =movetype CHECK =king 1148 def threatened anytrue lambda (fn const alias space #0 #0 var king) elem var king threats =movetype CHECK =king 1149 sub uncheckedpath start finish 1150 my from to piece kingpos 1151 local movetype 1152 set movetype CHECK 1153 if empty #finish 1154 set kingpos #start 1155 else 1156 set kingpos #finish 1157 endif 1158 if isupper space #kingpos 1159 def enemies onlylower 1160 else 1161 def enemies onlyupper 1162 endif 1163 for to path #start #finish 1164 move #kingpos #to 1165 for (from piece) fn enemies 1166 if fn const alias #piece #from #to 1167 move #to #kingpos 1168 return false 1169 endif 1170 next 1171 move #to #kingpos 1172 next 1173 return true 1174 endif 1175 sub uncheckedknightleap start finish 1176 my from to piece kingpos kingpiece checkedpaths 1177 local movetype 1178 set movetype CHECK 1179 if empty #start 1180 set kingpos #finish 1181 else 1182 set kingpos #start 1183 endif 1184 if isupper space #kingpos 1185 def enemies onlylower 1186 else 1187 def enemies onlyupper 1188 endif 1189 set kingpiece space #kingpos 1190 set avenues merge intersection leaps #start 1 0 leaps #finish 1 1 intersection leaps #start 1 1 leaps #finish 1 0 1191 set checkdpaths 0 1192 for to #avenues 1193 if empty #to 1194 move #kingpos #to 1195 else 1196 empty #kingpos 1197 endif 1198 for (from piece) fn enemies 1199 if fn const alias #piece #from #to 1200 inc checkedpaths 1201 break 1202 endif 1203 next 1204 if == space #to #kingpiece 1205 move #to #kingpos 1206 else 1207 add #kingpiece #kingpos 1208 endif 1209 if == checkedpaths 0 1210 break 1211 endif 1212 next 1213 return < var checkedpaths 2 1214 endif 1215 sub castle from to 1216 local coord RPOS RDEST xdir 1217 if not flag #from 1218 die A King may not castle after it moves. 1219 endif 1220 if capture 1221 die A King may not castle to an occupied space. 1222 endif 1223 set xdir sign minus file #to file #from 1224 if not checkaride #from #to #xdir 0 1225 die A King may not castle across any occupied space. 1226 endif 1227 set coord #to 1228 do 1229 set coord where #coord #xdir 0 1230 if flag #coord 1231 break 1232 elseif not onboard #coord 1233 die No piece was found to castle with. 1234 elseif not empty #coord 1235 die The King cannot castle with the piece at #coord 1236 endif 1237 loop 1238 set RPOS #coord 1239 move #to #from 1240 if sub checked #from 1241 die A King may not castle out of check. 1242 endif 1243 store 1244 for coord path #from #to 1245 move #from #coord 1246 if sub checked #coord 1247 die A King may not castle through check. 1248 endif 1249 restore 1250 next 1251 move #from #to 1252 set RDEST where #to neg #xdir 0 1253 move #RPOS #RDEST 1254 return true 1255 endsub 1256 sub castlepos from to 1257 local coord RPOS RDEST xdir safe 1258 verify flag #from 1259 verify empty #to 1260 set xdir sign minus file #to file #from 1261 verify checkaride #from #to #xdir 0 1262 verify not sub checked #from 1263 set coord #to 1264 do 1265 set coord where #coord #xdir 0 1266 if flag #coord 1267 break 1268 endif 1269 verify onboard #coord 1270 verify empty #coord 1271 loop 1272 verify flag #coord 1273 set RPOS #coord 1274 store 1275 for coord path #from #to 1276 move #from #coord 1277 set safe not sub checked #coord 1278 restore 1279 verify #safe 1280 next 1281 move #from #to 1282 set RDEST where #to neg #xdir 0 1283 move #RPOS #RDEST 1284 set safe not sub checked #to 1285 restore 1286 return #safe 1287 endsub 1288 sub castle2 kingfrom kingto rookfrom rookto 1289 local coord xdir king rook 1290 if not flag #kingfrom 1291 die A King may not castle after it moves. 1292 endif 1293 if not flag #rookfrom 1294 die A King may not castle with a piece that has already moved. 1295 endif 1296 if not match @ $lastcaptured $prevcaptured 1297 die Castling to an occupied space is not allowed. 1298 endif 1299 if empty #kingto 1300 die There is nothing on #kingto. Did you move a piece there and then move it away? 1301 endif 1302 if empty #rookto 1303 die There is nothing on #rookto. Did you move a piece there and then move it away? 1304 endif 1305 set king space #kingto 1306 set rook space #rookto 1307 if == #king #rook 1308 die "Castling must be between different pieces. These two are both {#king}. What happened?" 1309 endif 1310 empty #kingto 1311 empty #rookto 1312 add #king #kingfrom 1313 add #rook #rookfrom 1314 set xdir sign minus file #kingto file #kingfrom 1315 if not checkaride #kingfrom #kingto #xdir 0 1316 die A King may not castle across any occupied space. 1317 endif 1318 if not checkaride #rookto #rookfrom #xdir 0 1319 die A Rook may not castle across an occupied space. 1320 endif 1321 if sub checked #kingfrom 1322 die A King may not castle out of check. 1323 endif 1324 store 1325 for coord path #kingfrom #kingto 1326 move #kingfrom #coord 1327 if sub checked #coord 1328 die A King may not castle through check. 1329 endif 1330 restore 1331 next 1332 empty #kingfrom 1333 empty #rookfrom 1334 add #king #kingto 1335 add #rook #rookto 1336 unsetflag #kingfrom #rookfrom 1337 if isupper space #kingto 1338 set Kpos #kingto 1339 else 1340 set kpos #kingto 1341 endif 1342 return true 1343 endsub 1344 sub castlepos2 kingfrom kingto rookfrom rookto 1345 echo "Calling castlepos2" #kingfrom #kingto #rookfrom #rookto 1346 local coord xdir safe 1347 verify flag #kingfrom and flag #rookfrom 1348 echo "Verified flags" 1349 verify empty #kingto or == #kingto #rookfrom 1350 verify empty #rookto or == #rookto #kingfrom 1351 echo "Verified empty destinations" 1352 set xdir sign minus file #kingto file #kingfrom 1353 echo "xdir is {#xdir}" 1354 verify checkride #kingfrom #kingto #xdir 0 1355 echo "Verified checkride {#kingfrom} {#kingto} {#xdir} 0" 1356 verify checkride #rookto #rookfrom #xdir 0 1357 echo "Verified checkride {#kingto} {#kingfrom} {#xdir} 0" 1358 verify not sub checked #kingfrom 1359 echo "Verified not checked" 1360 store 1361 for coord path #kingfrom #kingto 1362 move #kingfrom #coord 1363 set safe not sub checked #coord 1364 restore 1365 verify #safe 1366 next 1367 move #kingfrom #kingto 1368 move #rookfrom #rookto 1369 set safe not sub checked #kingto 1370 restore 1371 return #safe 1372 endsub 1373 sub stalemated kingpos 1374 store 1375 local cspaces friend friends from king piece to movetype np prom promfn 1376 set movetype MOVE 1377 set king alias space #kingpos 1378 if hasupper #king 1379 set friends lambda (onlyupper) 1380 set free lambda (haslower #0 or not hasupper #0) 1381 set pzone lambda (not onboard where #0 0 var pzs) 1382 set cspaces var wcastle 1383 set prom var wprom 1384 else 1385 set friends lambda (onlylower) 1386 set free lambda (hasupper #0 or not haslower #0) 1387 set pzone lambda (not onboard where #0 0 neg var pzs) 1388 set cspaces var bcastle 1389 set prom var bprom 1390 endif 1391 store 1392 for (from piece) fn #friends 1393 set af alias #from 1394 for to fn join const alias #piece "-Range" #from 1395 set at alias #to 1396 if fn const alias #piece #from #to and fn #free alias space #to and onboard #to 1397 set ap alias #piece 1398 move #from #to 1399 if not sub checked cond == #from #kingpos #to #kingpos 1400 set promfn join const alias #piece "-Promote" 1401 if fn #pzone #to and match #piece #promotable 1402 if > count var prom 0 1403 for np var prom 1404 setlegal "{#ap} {#af}-{#at}; {#np}-{#at}" 1405 next 1406 endif 1407 elseif fn #pzone #to and isfunc var promfn 1408 set prom fn var promfn #to 1409 if > count var prom 0 1410 for np var prom 1411 setlegal "{#ap} {#af}-{#at}; {#np}-{#at}" 1412 next 1413 endif 1414 elseif fn #pzone #to and match #piece #promotable 1415 if > count var prom 0 1416 for np var prom 1417 setlegal "{#ap} {#af}-{#at}; {#np}-{#at}" 1418 next 1419 endif 1420 else 1421 setlegal "{#ap} {#af}-{#at}" 1422 endif 1423 endif 1424 endif 1425 restore 1426 next 1427 next 1428 if > count var cspaces 0 1429 for to var cspaces 1430 if sub castlepos #kingpos #to 1431 setlegal "{#king} {#kingpos}-{#to}" 1432 endif 1433 next 1434 endif 1435 setsystem autorules sub describe_rules 1436 return cond count system legalmoves false true 1437 endsub 1438 sub stalemated-quick kingpos 1439 store 1440 local checked checkpos cspaces enemies friend friends from in king piece threats to movetype np prom promfn 1441 set movetype MOVE 1442 set king alias space #kingpos 1443 if hasupper #king 1444 set friends lambda (onlyupper) 1445 set enemies lambda (onlylower) 1446 set free lambda (haslower #0 or not hasupper #0) 1447 set pzone lambda (not onboard where #0 0 var pzs) 1448 set cspaces var wcastle 1449 set prom var wprom 1450 else 1451 set friends lambda (onlylower) 1452 set enemies lambda (onlyupper) 1453 set free lambda (hasupper #0 or not haslower #0) 1454 set pzone lambda (not onboard where #0 0 neg var pzs) 1455 set cspaces var bcastle 1456 set prom var bprom 1457 endif 1458 set krange merge fn join const alias space #kingpos "-Range" #kingpos #kingpos 1459 set threats () 1460 for to #krange 1461 set threats.{#to} () 1462 next 1463 for (from piece) fn #enemies 1464 set in intersection var krange fn join const alias var piece "-Range" var from 1465 for to #in 1466 push threats.{#to} #from 1467 next 1468 next 1469 store 1470 for (from piece) fn #friends 1471 set af alias #from 1472 for to fn join const alias #piece "-Range" #from 1473 set at alias #to 1474 if fn const alias #piece #from #to and fn #free alias space #to and onboard #to 1475 set ap alias #piece 1476 set checkpos cond == #from #kingpos #to #kingpos 1477 set checked false 1478 if count elem var checkpos threats 1479 move #from #to 1480 set checked fn threatened #checkpos 1481 restore 1482 endif 1483 if not #checked 1484 set promfn join const alias #piece "-Promote" 1485 if fn #pzone #to and match #piece #promotable 1486 if > count var prom 0 1487 for np var prom 1488 setlegal "{#ap} {#af}-{#at}; {#np}-{#at}" 1489 next 1490 endif 1491 elseif fn #pzone #to and isfunc var promfn 1492 set prom fn var promfn #to 1493 if > count var prom 0 1494 for np var prom 1495 setlegal "{#ap} {#af}-{#at}; {#np}-{#at}" 1496 next 1497 endif 1498 elseif fn #pzone #to and match #piece #promotable 1499 if > count var prom 0 1500 for np var prom 1501 setlegal "{#ap} {#af}-{#at}; {#np}-{#at}" 1502 next 1503 endif 1504 else 1505 setlegal "{#ap} {#af}-{#at}" 1506 endif 1507 endif 1508 endif 1509 restore 1510 next 1511 next 1512 if > count var cspaces 0 1513 for to var cspaces 1514 if sub castlepos #kingpos #to 1515 setlegal "{#king} {#kingpos}-{#to}" 1516 endif 1517 next 1518 endif 1519 setsystem autorules sub describe_rules 1520 return cond count system legalmoves false true 1521 endsub 1522 sub stalemated2 kingpos 1523 store 1524 local cspaces friend friends from piece to movetype 1525 set movetype MOVE 1526 if isupper space #kingpos 1527 set friends (onlyupper) 1528 set friend (isupper #0) 1529 set cspaces var wcastle 1530 else 1531 set friends (onlylower) 1532 set friend (islower #0) 1533 set cspaces var bcastle 1534 endif 1535 set royal space var kingpos 1536 store 1537 for (from piece) fn #friends 1538 for to fn join const alias #piece "-Range" #from 1539 if fn const alias #piece #from #to and not fn #friend space #to and onboard #to 1540 move #from #to 1541 if not sub checked cond == #from #kingpos #to #kingpos 1542 set ap alias #piece 1543 setlegal "{#ap} {#from}-{#to}" 1544 endif 1545 endif 1546 restore 1547 next 1548 next 1549 if > count var cspaces 0 and flag #kingpos 1550 for mvs var cspaces 1551 if sub castlepos2 #mvs.0 #mvs.1 #mvs.2 #mvs.3 and == #kingpos #mvs.0 1552 set pk alias space #mvs.0 1553 set pr alias space #mvs.2 1554 setlegal "{#pk} {#mvs.0}-{#mvs.1}; {#pr} {#mvs.2}-{#mvs.3}" 1555 endif 1556 next 1557 endif 1558 setsystem autorules sub describe_rules 1559 return cond count system legalmoves false true 1560 endsub 1561 sub fusion-stalemated kingpos 1562 store 1563 local cspaces friend friends from piece to movetype mv ss 1564 set movetype MOVE 1565 set ss join chr 47 chr 47 1566 if isupper space #kingpos 1567 set friends (onlyupper) 1568 set friend (isupper #0) 1569 set cspaces var wcastle 1570 else 1571 set friends (onlylower) 1572 set friend (islower #0) 1573 set cspaces var bcastle 1574 endif 1575 set royal space var kingpos 1576 store 1577 set kp #kingpos 1578 for (from piece) fn #friends 1579 set ap alias #piece 1580 for to fn join const #ap "-Range" #from 1581 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 1582 move #from #to 1583 if match #ap K KR KB KN k kr kb kn 1584 set kp #to 1585 endif 1586 if not sub checked #kp 1587 setlegal "{#ap} {#from}-{#to}" 1588 endif 1589 restore 1590 set kp #kingpos 1591 endif 1592 if not sub checked #from and empty #to and == strlen alias #piece 2 1593 set compound alias #piece 1594 set simple1 leftstr #compound 1 1595 set simple2 rightstr #compound 1 1596 if != not fn #friend space #to and fn const alias #simple1 #from #to 1597 add #simple1 #to 1598 add #simple2 #from 1599 if match #simple1 K k 1600 set kp #to 1601 endif 1602 if not sub checked #kp 1603 setlegal "{#simple1} {#from}-{#to}; {#ss} {#simple2}-{#from}" 1604 endif 1605 restore 1606 set kp #kingpos 1607 endif 1608 if != not fn #friend space #to and fn const alias #simple2 #from #to 1609 add #simple2 #to 1610 add #simple1 #from 1611 if match #simple1 K k 1612 set kp #from 1613 endif 1614 if not sub checked #kp 1615 setlegal "{#simple2} {#from}-{#to}; {#ss} {#simple1}-{#from}" 1616 endif 1617 restore 1618 set kp #kingpos 1619 endif 1620 endif 1621 next 1622 next 1623 if > count var cspaces 0 1624 for to var cspaces 1625 if sub castlepos #kingpos #to 1626 setlegal (#kingpos #to) 1627 endif 1628 next 1629 endif 1630 setsystem autorules sub describe_rules 1631 return cond count system legalmoves false true 1632 endsub 1633 sub describe_rules 1634 my c piecenames notation values val id ref rules desc name codename rangefn 1635 set c.0 join filename 0 rankname 0 1636 set c.1 join filename >> lastfile 1 rankname 1 1637 set c.2 join filename inc >> lastfile 1 rankname 1 1638 set c.3 join filename >> lastfile 1 rankname inc >> lastrank 1 1639 set c.4 join filename inc >> lastfile 1 rankname >> lastrank 1 1640 set c.5 join filename >> lastfile 1 rankname dec lastrank 1641 set c.6 join filename inc >> lastfile 1 rankname dec lastrank 1642 set c.7 join filename lastfile rankname lastrank 1643 foreach p keys $pieces 1644 if isconst alias #p 1645 set codename const alias #p 1646 set name alias #codename 1647 set notation.{#name} alias #p 1648 if match #codename const alias space #kpos const alias space #Kpos 1649 set values.{#name} * 8 count spaces 1650 else 1651 set rangefn join #codename "-Range" 1652 set values.{#name} sum lambda (count fn #rangefn #0) #c 1653 endif 1654 endif 1655 next 1656 set values reverse asort #values 1657 set rules "" 1658 foreach (name val) #values 1659 set codename realname #name 1660 if == null var #codename 1661 set codename #name 1662 endif 1663 set ref join #codename "-Desc" 1664 set desc str_replace "%s" #name var #ref 1665 set desc str_replace "_" " " #desc 1666 set id realname #notation.{#name} 1667 set rules join #rules "" 1670 return #rules 1671 endsub 1672 sub findmates side 1673 local enemyking king mates moves mv 1674 if match #side 1 white White first 1675 set king #Kpos 1676 set enemyking #kpos 1677 else 1678 set king #kpos 1679 set enemyking #Kpos 1680 endif 1681 set mates () 1682 ban none 1683 setsystem maxmove 0 1684 store main 1685 setsystem legalmoves () 1686 if not sub stalemated #king 1687 set lglmvs $legalmoves 1688 foreach move #lglmvs 1689 set moves explode chr 59 #move 1690 foreach mv #moves 1691 set mv trim #mv 1692 eval "MOVE: {#mv}" 1693 next 1694 if sub checked #enemyking 1695 setsystem legalmoves () 1696 if sub stalemated #enemyking 1697 push mates #move 1698 endif 1699 endif 1700 restore main 1701 next 1702 endif 1703 setsystem legalmoves #mates 1704 endsub 1705 endlib[pc {#id} {#name}]{#desc}[/pc]" 1668 next 1669 set rules join #rules "functions
Array ( [None] => Array ( [0] => == [1] => #0 [2] => #1 [3] => and [4] => != [5] => #0 [6] => #1 ) [None-Range] => Array ( [0] => Array ( [0] => Array ( ) [1] => Array ( ) ) ) [White_Barren_Pawn] => Array ( [0] => checkaleap [1] => #0 [2] => #1 [3] => 0 [4] => 1 [5] => and [6] => cond [7] => empty [8] => #0 [9] => not [10] => capture [11] => empty [12] => #1 [13] => or [14] => and [15] => or [16] => checkaleap [17] => #0 [18] => #1 [19] => -1 [20] => 1 [21] => checkaleap [22] => #0 [23] => #1 [24] => 1 [25] => 1 [26] => cond [27] => empty [28] => #0 [29] => capture [30] => islower [31] => space [32] => #1 ) [White_Barren_Pawn-Range] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 1 [4] => 0 [5] => leaps [6] => #0 [7] => 1 [8] => 1 ) [Black_Barren_Pawn] => Array ( [0] => checkaleap [1] => #0 [2] => #1 [3] => 0 [4] => -1 [5] => and [6] => cond [7] => empty [8] => #0 [9] => not [10] => capture [11] => empty [12] => #1 [13] => or [14] => and [15] => or [16] => checkaleap [17] => #0 [18] => #1 [19] => -1 [20] => -1 [21] => checkaleap [22] => #0 [23] => #1 [24] => 1 [25] => -1 [26] => cond [27] => empty [28] => #0 [29] => capture [30] => isupper [31] => space [32] => #1 ) [Black_Barren_Pawn-Range] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 1 [4] => 0 [5] => leaps [6] => #0 [7] => 1 [8] => 1 ) [Sangoma] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 2 [4] => 3 [5] => or [6] => fn [7] => Bishop [8] => #0 [9] => #1 ) [Sangoma-Range] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 2 [4] => 3 [5] => rays [6] => #0 [7] => 1 [8] => 1 ) [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] => 1 [4] => 2 ) [Knight-Range] => Array ( [0] => leaps [1] => #0 [2] => 1 [3] => 2 ) [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] => Bishop [2] => #0 [3] => #1 [4] => or [5] => fn [6] => Rook [7] => #0 [8] => #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 ) [Griffin] => 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 ) [Griffin-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 ) [Dragon] => 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 ) [Dragon-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 ) [ACMKnight] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 3 [4] => 0 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 2 [10] => 2 [11] => and [12] => cond [13] => empty [14] => #0 [15] => not [16] => capture [17] => empty [18] => #1 [19] => or [20] => checkleap [21] => #0 [22] => #1 [23] => 2 [24] => 1 ) [ACMKnight-Range] => Array ( [0] => merge [1] => merge [2] => leaps [3] => #0 [4] => 3 [5] => 0 [6] => leaps [7] => #0 [8] => 2 [9] => 2 [10] => leaps [11] => #0 [12] => 2 [13] => 1 ) [Apothecary_King] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 3 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 1 [10] => 2 [11] => and [12] => not [13] => sub [14] => checked [15] => #0 [16] => and [17] => match [18] => rankname [19] => #1 [20] => 1 [21] => 10 [22] => and [23] => flag [24] => #0 [25] => or [26] => checkleap [27] => #0 [28] => #1 [29] => 1 [30] => 0 [31] => or [32] => checkleap [33] => #0 [34] => #1 [35] => 1 [36] => 1 ) [Apothecary_King-Range] => Array ( [0] => merge [1] => merge [2] => leaps [3] => #0 [4] => 1 [5] => 0 [6] => leaps [7] => #0 [8] => 1 [9] => 1 [10] => merge [11] => leaps [12] => #0 [13] => 1 [14] => 2 [15] => leaps [16] => #0 [17] => 1 [18] => 3 ) [White_Joker] => Array ( [0] => fn [1] => str_replace [2] => Black_ [3] => White_ [4] => var [5] => last_type_moved [6] => #0 [7] => #1 ) [Black_Joker] => Array ( [0] => fn [1] => str_replace [2] => White_ [3] => Black_ [4] => var [5] => last_type_moved [6] => #0 [7] => #1 ) [White_Joker-Range] => Array ( [0] => fn [1] => join [2] => str_replace [3] => Black_ [4] => White_ [5] => var [6] => last_type_moved [7] => -Range [8] => #0 ) [Black_Joker-Range] => Array ( [0] => fn [1] => join [2] => str_replace [3] => White_ [4] => Black_ [5] => var [6] => last_type_moved [7] => -Range [8] => #0 ) )uservar
Array ( [0] => Array ( [main] => Array ( [kpos] => f9 [Kpos] => f2 [ep] => [last_type_moved] => None [Sangoma-desc] => The %s Shaman has the powers of Bishop and Zebra [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.
[Aanca-Desc] => [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] => [King-Desc] => The %s King moves 1 square as a regular king but once in a game may jump the row behind 2 or 3 spaces away [Knight-Desc] => The %s may leap to any space that is one rank and two files away or two ranks and one file away. [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 may move as a Rook or a Bishop. [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. [ACMKnight-Desc] => The %s Knight besides it's regular move may jump 3 squares orthogonally or 2 diagonally [pzs] => 3 [wpr] => 3 [bpr] => 8 [fps] => 2 [wcastle] => [bcastle] => [lastpiece] => p [coin1] => 0 [coin2] => 1 [op] => Array ( [w] => 2 [z] => 2 [r] => 3 [j] => 1 [c] => 3 [g] => 1 [b] => 2 [n] => 3 [d] => 1 [k] => 1 [q] => 2 [p] => 10 [P] => 10 [G] => 1 [B] => 2 [N] => 3 [D] => 1 [K] => 1 [Q] => 2 [R] => 3 [C] => 3 [J] => 1 [W] => 2 [Z] => 2 ) ) ) )mline
Array ( [0] => MoveLine Object ( [movenum] => 1 [move] => P e3-e5 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 1 ) [1] => MoveLine Object ( [movenum] => 2 [move] => p e8-e6 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 1 ) [2] => MoveLine Object ( [movenum] => 3 [move] => P f3-f4 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 2 ) [3] => MoveLine Object ( [movenum] => 4 [move] => d d9-e8 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 2 ) [4] => MoveLine Object ( [movenum] => 5 [move] => P h3-h4 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 3 ) [5] => MoveLine Object ( [movenum] => 6 [move] => p h8-h7 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 3 ) [6] => MoveLine Object ( [movenum] => 7 [move] => B i2-e6 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 4 ) [7] => MoveLine Object ( [movenum] => 8 [move] => p f8-f7 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 4 ) [8] => MoveLine Object ( [movenum] => 9 [move] => B e6-h3 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 5 ) [9] => MoveLine Object ( [movenum] => 10 [move] => w g11-f8 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 5 ) [10] => MoveLine Object ( [movenum] => 11 [move] => J f0-e3 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 6 ) [11] => MoveLine Object ( [movenum] => 12 [move] => n c9-b7 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 6 ) [12] => MoveLine Object ( [movenum] => 13 [move] => W g0-f3 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 7 ) [13] => MoveLine Object ( [movenum] => 14 [move] => p d8-d6 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 7 ) [14] => MoveLine Object ( [movenum] => 15 [move] => P c3-c4 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 8 ) [15] => MoveLine Object ( [movenum] => 16 [move] => p d6-e5 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 8 ) [16] => MoveLine Object ( [movenum] => 17 [move] => B b2-e5 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 9 ) [17] => MoveLine Object ( [movenum] => 18 [move] => b i9-e5 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 9 ) [18] => MoveLine Object ( [movenum] => 19 [move] => P f4-e5 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 10 ) [19] => MoveLine Object ( [movenum] => 20 [move] => w f8-e5 [level] => 0 [comment] => // - Check! - [length] => 27 [newturn] => [turn] => 10 ) [20] => MoveLine Object ( [movenum] => 21 [move] => resign [level] => 0 [comment] => // - Aurelian Florea has resigned. - [length] => 47 [newturn] => 1 [turn] => 11 ) )allmoves
Array ( [0] => moveindex 20;MOVE: resign;postauto1 [1] => moveindex 19;MOVE: w f8-e5;postauto2 [2] => moveindex 18;MOVE: P f4-e5;postauto1 [3] => moveindex 17;MOVE: b i9-e5;postauto2 [4] => moveindex 16;MOVE: B b2-e5;postauto1 [5] => moveindex 15;MOVE: p d6-e5;postauto2 [6] => moveindex 14;MOVE: P c3-c4;postauto1 [7] => moveindex 13;MOVE: p d8-d6;postauto2 [8] => moveindex 12;MOVE: W g0-f3;postauto1 [9] => moveindex 11;MOVE: n c9-b7;postauto2 [10] => moveindex 10;MOVE: J f0-e3;postauto1 [11] => moveindex 9;MOVE: w g11-f8;postauto2 [12] => moveindex 8;MOVE: B e6-h3;postauto1 [13] => moveindex 7;MOVE: p f8-f7;postauto2 [14] => moveindex 6;MOVE: B i2-e6;postauto1 [15] => moveindex 5;MOVE: p h8-h7;postauto2 [16] => moveindex 4;MOVE: P h3-h4;postauto1 [17] => moveindex 3;MOVE: d d9-e8;postauto2 [18] => moveindex 2;MOVE: P f3-f4;postauto1 [19] => moveindex 1;MOVE: p e8-e6;postauto2 [20] => moveindex 0;MOVE: P e3-e5;postauto1 )movelist
1. P e3-e5 1... p e8-e6 2. P f3-f4 2... d d9-e8 3. P h3-h4 3... p h8-h7 4. B i2-e6 4... p f8-f7 5. B e6-h3 5... w g11-f8 6. J f0-e3 6... n c9-b7 7. W g0-f3 7... p d8-d6 8. P c3-c4 8... p d6-e5 9. B b2-e5 9... b i9-e5 10. P f4-e5 10... w f8-e5 // - Check! - 11. resign // - Aurelian Florea has resigned. -constants
Array ( [d] => Dragon [D] => Dragon [g] => Griffin [G] => Griffin [c] => Champion [C] => Champion [W] => Wizard [w] => Wizard [N] => ACMKnight [n] => ACMKnight [p] => Black_Pawn [P] => White_Pawn [q] => Queen [Q] => Queen [r] => Rook [R] => Rook [b] => Bishop [B] => Bishop [k] => Apothecary_King [K] => Apothecary_King [j] => Black_Joker [J] => White_Joker [z] => Sangoma [Z] => Sangoma )