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 g3-g5 275 postauto1 276 moveindex 1 277 MOVE: p e8-e6 278 postauto2 279 moveindex 2 280 MOVE: P f3-f5 281 postauto1 282 moveindex 3 283 MOVE: p e6-f5 284 postauto2 285 moveindex 4 286 MOVE: N i2-h4 287 postauto1 288 moveindex 5 289 MOVE: w d11-e8 290 postauto2 291 moveindex 6 292 MOVE: R j1-f1 293 postauto1 294 moveindex 7 295 MOVE: w e8-d5 296 postauto2 297 moveindex 8 298 MOVE: Q e2-h5 299 postauto1 300 moveindex 9 301 MOVE: w d5-c2 302 postauto2 303 moveindex 10 304 MOVE: C e0-c2 305 postauto1 306 moveindex 11 307 MOVE: n i9-g7 308 postauto2 309 moveindex 12 310 MOVE: Q h5-i4 311 postauto1 312 moveindex 13 313 MOVE: p i8-i7 314 postauto2 315 moveindex 14 316 MOVE: R a1-e1 317 postauto1 318 moveindex 15 319 MOVE: b h9-i8 320 postauto2 321 moveindex 16 322 MOVE: B h2-b8 323 postauto1 324 moveindex 17 325 MOVE: p c8-c7 326 postauto2 327 moveindex 18 328 MOVE: B b8-c9 329 postauto1 330 moveindex 19 331 MOVE: c e11-c9 332 postauto2 333 moveindex 20 334 MOVE: K f2-i1 335 postauto1 336 moveindex 21 337 MOVE: c c9-e7 338 postauto2 339 moveindex 22 340 MOVE: P e3-e4 341 postauto1 342 moveindex 23 343 MOVE: p f5-e4 344 postauto2 345 moveindex 24 346 MOVE: R e1-e4 347 postauto1 348 moveindex 25 349 MOVE: r j10-f10 350 postauto2 351 moveindex 26 352 MOVE: P d3-d5 353 postauto1 354 moveindex 27 355 MOVE: q e9-e8 356 postauto2 357 moveindex 28 358 MOVE: Q i4-e8 359 postauto1 360 moveindex 29 361 MOVE: d d9-e8 362 postauto2 363 moveindex 30 364 MOVE: G g2-g3 365 postauto1 366 moveindex 31 367 MOVE: k f9-i10 368 postauto2 369 moveindex 32 370 MOVE: D d2-e1 371 postauto1 372 moveindex 33 373 MOVE: b i8-e4 374 postauto2 375 moveindex 34 376 MOVE: C c2-e4 377 postauto1 378 moveindex 35 379 MOVE: c e7-g5 380 postauto2 381 moveindex 36 382 MOVE: G g3-h1 383 postauto1 384 moveindex 37 385 MOVE: c g5-i5 386 postauto2 387 moveindex 38 388 MOVE: C e4-c6 389 postauto1 390 moveindex 39 391 MOVE: d e8-c9 392 postauto2 393 moveindex 40 394 MOVE: W d0-e3 395 postauto1 396 moveindex 41 397 MOVE: c h11-f9 398 postauto2 399 moveindex 42 400 MOVE: N b2-d4 401 postauto1 402 moveindex 43 403 MOVE: j f11-d9 404 postauto2 405 moveindex 44 406 MOVE: W e3-f6 407 postauto1 408 moveindex 45 409 MOVE: g g9-j7 410 postauto2 411 moveindex 46 412 MOVE: W f6-i5 413 postauto1 414 moveindex 47 415 MOVE: g j7-i5 416 postauto2 417 moveindex 48 418 MOVE: P j3-j4 419 postauto1 420 moveindex 49 421 MOVE: g i5-h7 422 postauto2 423 moveindex 50 424 MOVE: K i1-i2 425 postauto1 426 moveindex 51 427 MOVE: w g11-d10 428 postauto2 429 moveindex 52 430 MOVE: D e1-d3 431 postauto1 432 moveindex 53 433 MOVE: w d10-e7 434 postauto2 435 moveindex 54 436 MOVE: W g0-d1 437 postauto1 438 moveindex 55 439 MOVE: w e7-d4 440 postauto2 441 moveindex 56 442 MOVE: P c3-d4 443 postauto1 444 moveindex 57 445 MOVE: d c9-b3 446 postauto2 447 moveindex 58 448 MOVE: K i2-i1 449 postauto1 450 moveindex 59 451 MOVE: c f9-f7 452 postauto2 453 moveindex 60 454 MOVE: W d1-e4 455 postauto1 456 moveindex 61 457 MOVE: d b3-a7 458 postauto2 459 moveindex 62 460 MOVE: C c6-e6 461 postauto1 462 moveindex 63 463 MOVE: n b9-b6 464 postauto2 465 moveindex 64 466 MOVE: C e6-g8 467 postauto1 468 moveindex 65 469 MOVE: k i10-h9 470 postauto2 471 moveindex 66 472 MOVE: C g8-g6 473 postauto1 474 moveindex 67 475 MOVE: n b6-d5 476 postauto2 477 moveindex 68 478 MOVE: R f1-f7 479 postauto1 480 moveindex 69 481 MOVE: g h7-e3 482 postauto2 483 moveindex 70 484 MOVE: G h1-e5 485 postauto1 486 moveindex 71 487 MOVE: j d9-e9 488 postauto2 489 moveindex 72 490 MOVE: R f7-e7 491 postauto1 492 moveindex 73 493 MOVE: resign 494 postauto2 495 set posvar join "b" join fencode boardflags 496 if >= var #posvar 3 497 say Three Times Repetition! Drawn Game! 498 drawn 499 elseif sub stalemated var Kpos 500 if sub checked var Kpos 501 say Checkmate! Black has won! 502 won 503 else 504 say Stalemate! The game is drawn. 505 drawn 506 endif 507 elseif >= #nopvc 100 508 say One Hundred Moves Without Moving a Pawn or Capturing! Game Drawn! 509 drawn 510 elseif sub checked var Kpos 511 say Check! 512 endif 513 end 514 end 515 516 lib fairychess 517 if flag use-chess-defaults 518 setconst k King 519 setconst K King 520 setconst q Queen 521 setconst Q Queen 522 setconst r Rook 523 setconst R Rook 524 setconst b Bishop 525 setconst B Bishop 526 setconst n Knight 527 setconst N Knight 528 setconst p Black_Pawn 529 setconst P White_Pawn 530 endif 531 if flag use-chess-defaults 532 set wpr 2 533 set bpr 7 534 set fps 2 535 set pzs 1 536 set wcastle c1 g1 537 set bcastle c8 g8 538 set wprom Q R B N 539 set bprom q r b n 540 set promotable p P 541 elseif not isset wpr 542 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 543 elseif not isset bpr 544 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 545 elseif not isset fps 546 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 547 elseif not isset pzs 548 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 549 elseif not isset wcastle 550 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 551 elseif not isset bcastle 552 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 553 elseif not isset wprom 554 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 555 elseif not isset bprom 556 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 557 endif 558 set ep false 559 setsystem maxmove 2 560 ban commands allmoves 561 allow moves 1 captures 1 promotions 2 562 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." 563 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 564 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 565 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." 566 def Amazon fn Bishop #0 #1 or fn Rook #0 #1 or fn Knight #0 #1 567 def Amazon-Range merge leaps # 1 2 merge rays #0 1 0 rays #0 1 1 568 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." 569 def Bede checkride #0 #1 1 1 or checkleap #0 #1 0 2 570 def Bede-Range merge rays #0 1 1 leaps #0 0 2 571 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 572 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 573 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 574 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 575 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." 576 set Black_Berolina_Pawn-Desc var White_Berolina_Pawn-Desc 577 sub White_Berolina_Pawn from to 578 verify > rank #to rank #from 579 verify <= distance #to #from #fps 580 if capture 581 verify checkleap #from #to 1 0 582 set epp false 583 set epc false 584 elseif checkleap #from #to 1 0 and == #to #epp 585 capture #epc 586 set epp false 587 set epc false 588 elseif > distance #to #from 1 589 verify == rankname #from #wpr 590 verify checkride #from #to 1 1 591 set epp elem 0 path #from #to 592 set epc #to 593 else 594 verify checkleap #from #to 1 1 595 set epp false 596 set epc false 597 endif 598 if onboard where #to 0 #pzs 599 if != space #to $moved 600 set name alias const alias $moved 601 die "You may not promote a" #name "until it reaches the promotion zone." 602 endif 603 elseif onboard where #to 0 1 604 if == White_Berolina_Pawn const alias space #to and count var wprom 605 if not $answered and == mln $maxmln 606 push wprom space #to 607 askpromote #wprom 608 endif 609 elseif not match space #to var wprom and != White_Pawn const alias space #to 610 set name alias const alias $moved 611 set newname alias const alias space #to 612 set msg list "You may not promote your" #name "to a" join #newname ".
" 613 set msg str_replace "_" " " var msg 614 die #msg 615 endif 616 elseif count var wprom 617 if == White_Berolina_Pawn const alias space #to 618 if == count var wprom 1 619 set newpiece join list var wprom 620 set newmove join #newpiece "-dest" 621 add #newpiece $dest 622 appendmove #newmove 623 else 624 askpromote #wprom 625 endif 626 elseif not match space #to var wprom 627 set name alias const alias $moved 628 set newname alias const alias space #to 629 set msg list "You may not promote your" #name "to a" join #newname ".
" 630 set msg str_replace "_" " " var msg 631 die #msg 632 endif 633 else 634 set name alias const alias $moved 635 set msg list "You may not advance your" #name "to the last rank, because there is nothing you may promote it to." 636 set msg str_replace "_" " " var msg 637 die #msg 638 endif 639 set nopvc 0 640 return true 641 endsub 642 sub Black_Berolina_Pawn from to 643 verify < rank #to rank #from 644 verify <= distance #to #from #fps 645 if capture 646 verify checkleap #from #to 1 0 647 set epp false 648 set epc false 649 elseif checkleap #from #to 1 0 and == #to #epp 650 capture #epc 651 set epp false 652 set epc false 653 elseif > distance #to #from 1 654 verify == rankname #from #bpr 655 verify checkride #from #to 1 1 656 set epp elem 0 path #from #to 657 set epc #to 658 else 659 verify checkleap #from #to 1 1 660 set epp false 661 set epc false 662 endif 663 if onboard where #to 0 neg #pzs 664 if != space #to $moved 665 set name alias const alias $moved 666 die "You may not promote a" #name "until it reaches the promotion zone." 667 endif 668 elseif onboard where #to 0 -1 669 if == Black_Berolina_Pawn const alias space #to and count var bprom 670 if not $answered and == mln $maxmln 671 push bprom space #to 672 askpromote #bprom 673 endif 674 elseif not match space #to var bprom and != Black_Pawn const alias space #to 675 set name alias const alias $moved 676 set newname alias const alias space #to 677 set msg list "You may not promote your" #name "to a" join #newname ".
" 678 set msg str_replace "_" " " var msg 679 die #msg 680 endif 681 elseif count var bprom 682 if == Black_Berolina_Pawn const alias space #to 683 if == count var bprom 1 684 set newpiece join list var bprom 685 set newmove join #newpiece "-dest" 686 add #newpiece $dest 687 appendmove #newmove 688 else 689 askpromote #bprom 690 endif 691 elseif not match space #to var bprom 692 set name alias const alias $moved 693 set newname alias const alias space #to 694 set msg list "You may not promote your" #name "to a" join #newname ".
" 695 set msg str_replace "_" " " var msg 696 die #msg 697 endif 698 else 699 set name alias const alias $moved 700 set msg list "You may not advance your" #name "to the last rank, because there is nothing you may promote it to." 701 set msg str_replace "_" " " var msg 702 die #msg 703 endif 704 set nopvc 0 705 return true 706 endsub 707 def Bishop checkride #0 #1 1 1 708 def Bishop-Range rays #0 1 1 709 set Bishop-Desc "The %s may move diagonally any number of spaces until it reaches an occupied space." 710 def Cannon cond cond empty #0 capture (not empty #1) (checkhop #0 #1 0 1) (checkride #0 #1 0 1) and #1 711 def Cannon-Range rays #0 1 0 712 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." 713 def Camel checkleap #0 #1 1 3 714 def Camel-Range leaps #0 1 3 715 set Camel-Desc "The %s leaps to any space at the opposite corner of a 1x3 rectangle." 716 def Camelrider checkride #0 #1 1 3 717 def Camelrider-Range rays #0 1 3 718 set Camelrider-Desc "The %s may make any number of Camel moves in the same direction until it lands on an occupied space." 719 def Cardinal fn Bishop #0 #1 or fn Knight #0 #1 720 def Cardinal-Range merge leaps #0 1 2 rays #0 1 1 721 set Cardinal-Desc "The %s may move along diagonals as a Bishop or leap as a Knight." 722 def Centaur checkleap #0 #1 1 1 or checkleap #0 #1 1 0 or checkleap #0 #1 1 2 723 def Centaur-Range merge leaps #0 1 2 merge leaps #0 1 0 leaps #0 1 1 724 set Centaur-Desc "The %s may move to any adjacent space as a King or leap like a Knight." 725 def Champion fn Elephant #0 #1 or fn Dabbabah #0 #1 or fn Wazir #0 #1 726 def Champion-Range mergeall leaps #0 2 2 leaps #0 2 0 leaps #0 1 0 727 set Champion-Desc "The %s may leap one or two spaces orthogonally or two spaces diagonally." 728 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) 729 def White_Charging_Knight-Range mergeall leaps #0 1 2 leaps #0 1 1 leaps #0 1 0 730 set White_Charging_Knight-Desc "The %s may leap forward as a Knight or move one space sideways or backwards like a King." 731 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) 732 def Black_Charging_Knight-Range mergeall leaps #0 1 2 leaps #0 1 1 leaps #0 1 0 733 set Black_Charging_Knight-Desc "The %s may leap forward as a Knight or move one space sideways or backwards like a King." 734 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 735 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 736 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." 737 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 738 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 739 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." 740 def Chinese_Elephant checkpath #0 #1 1 1 1 1 741 def Chinese_Elephant-Range leaps #0 2 2 742 set Chinese_Elephant-Desc "The %s may move two spaces diagonally so long as the space in between is empty." 743 def White_Chinese_Elephant checkpath #0 #1 1 1 1 1 and < rank #1 + 1 / lastrank 2 744 def White_Chinese_Elephant-Range leaps #0 2 2 745 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." 746 def Black_Chinese_Elephant checkpath #0 #1 1 1 1 1 and >= rank #1 + 1 / lastrank 2 747 def Black_Chinese_Elephant-Range leaps #0 2 2 748 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." 749 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 750 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 751 def Chinese_General == distance #0 #1 1 or == var movetype CHECK and checkride #0 #1 1 0 and flag #1 752 def Chinese_General-Range leaps #0 1 0 753 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." 754 def Chinese_Guard checkleap #0 #1 1 1 and flag #1 755 def Chinese_Guard-Range leaps #0 1 1 756 set Chinese_Guard-Desc "The %s may move one space diagonally within the confines of the palace." 757 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 758 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 759 def White_Chinese_Pawn-Range leaps #0 1 0 760 def Black_Chinese_Pawn-Range leaps #0 1 0 761 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." 762 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." 763 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 764 def White_Colonel mergeall rays #0 1 0 leaps #0 1 2 leaps #0 1 1 765 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." 766 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 767 def Black_Colonel mergeall rays #0 1 0 leaps #0 1 2 leaps #0 1 1 768 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." 769 def Dabbabah checkleap #0 #1 0 2 770 def Dabbabah-Range leaps #0 0 2 771 set Dabbabah-Desc "The %s may leap two spaces vertically or horizontally." 772 def Dabbabahrider checkride #0 #1 0 2 773 def Dabbabahrider-Range rays #0 0 2 774 set Dabbabahrider-Desc "The %s may make any number of two space orthogonal leaps in the same direction until it reaches an occupied space." 775 def Dragon_Horse checkride #0 #1 1 1 or checkleap #0 #1 1 0 776 def Dragon_Horse-Range merge leaps #0 1 0 rays #0 1 1 777 set Dragon_Horse-Desc "The %s may move along diagonals as a Bishop or move one space orthogonally as a Wazir." 778 def Dragon_King checkride #0 #1 1 0 or checkleap #0 #1 1 1 779 def Dragon_King-Range merge leaps #0 1 1 rays #0 1 0 780 set Dragon_King-Desc "The %s may move along its rank or file as a Rook or one space diagonally as a Ferz." 781 def Elephant checkleap #0 #1 2 2 782 def Elephant-Range leaps #0 2 2 783 set Elephant-Desc "The %s may leap two spaces in any diagonal direction." 784 def Elephantrider checkride #0 #1 2 2 785 def Elephantrider-Range rays #0 2 2 786 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." 787 def Eques_Rex checkleap #0 #1 1 1 or checkleap #0 #1 1 0 or checkleap #0 #1 1 2 788 def Eques_Rex-Range merge leaps #0 1 2 merge leaps #0 1 0 leaps #0 1 1 789 set Eques_Rex-Desc "The %s may move to any adjacent space as a King or leap like a Knight." 790 def Fad checkleap #0 #1 1 1 or checkleap #0 #1 2 2 or checkleap #0 #1 2 0 791 def Fad-Range mergeall leaps #0 1 1 leaps #0 2 2 leaps #0 2 0 792 set Fad-Desc "The %s may move one space diagonally, or it may leap two spaces diagonally or orthogonally." 793 def Ferz checkleap #0 #1 1 1 794 def Ferz-Range leaps #0 1 1 795 set Ferz-Desc "The %s may move one space diagonally." 796 def Fibnif checkleap #0 #1 1 2 or checkleap #0 #1 1 1 and == 1 abs - file #0 file #1 797 def Fibnif-Range merge leaps #0 1 2 leaps #0 1 1 798 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." 799 def Giraffe checkleap #0 #1 1 4 800 def Giraffe-Range leaps #0 1 4 801 set Giraffe-Desc "The %s may leap to any space that is one file and four ranks or one rank and four files away." 802 def White_Gold_General checkaleap #0 #1 1 1 or checkaleap #0 #1 -1 1 or checkleap #0 #1 0 1 803 def White_Gold_General-Range mergeall leaps #0 1 0 where #0 1 1 where #0 -1 1 804 set White_Gold_General-Desc "The %s may move one space in any orthgonal direction or one space diagonally forward." 805 def Black_Gold_General checkaleap #0 #1 1 -1 or checkaleap #0 #1 -1 -1 or checkleap #0 #1 0 1 806 def Black_Gold_General-Range mergeall leaps #0 1 0 where #0 1 -1 where #0 -1 -1 807 set Black_Gold_General-Desc "The %s may move one space in any orthgonal direction or one space diagonally forward." 808 def Grasshopper checkgrasshop #0 #1 1 1 or checkgrasshop #0 #1 1 0 809 def Grasshopper-Range merge rays #0 1 0 rays #0 1 1 810 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." 811 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 812 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 813 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." 814 def King checkleap #0 #1 1 1 or checkleap #0 #1 1 0 815 def King-Range merge leaps #0 1 0 leaps #0 1 1 816 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." 817 sub King from to 818 if not fn King #from #to 819 verify sub castle #from #to and match #to var cond isupper space #to wcastle bcastle 820 endif 821 if isupper space #to 822 set Kpos #to 823 else 824 set kpos #to 825 endif 826 return true 827 endsub 828 def Knight checkleap #0 #1 1 2 829 def Knight-Range leaps #0 1 2 830 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." 831 def Korean_Elephant checkpath #0 #1 1 0 1 1 1 1 832 def Korean_Elephant-Range leaps #0 2 3 833 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." 834 def White_Lance checkaride #0 #1 0 1 835 def White_Lance-Range ray #0 0 1 836 set "The %s may move forward in its file as a Rook." 837 def Black_Lance checkaride #0 #1 0 -1 838 def Black_Lance-Range ray #0 0 -1 839 set "The %s may move forward in its file as a Rook." 840 def Leo fn Vao #0 #1 or fn Cannon #0 #1 841 def Leo-Range merge rays #0 1 0 rays #0 1 1 842 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." 843 def Mao checktwostep #0 #1 0 1 1 1 844 def Mao-Range leaps #0 1 2 845 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." 846 def Marshall fn Knight #0 #1 or fn Rook #0 #1 847 def Marshall-Range merge rays #0 1 0 leaps #0 1 2 848 set Marshall-Desc "The %s moves orthogonally as a Rook or leaps as a Knight." 849 def Moa checktwostep #0 #1 1 1 0 1 850 def Moa-Range leaps #0 1 2 851 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." 852 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 853 def Murray_Lion-Range merge merge leaps #0 2 0 leaps #0 2 2 merge leaps #0 1 0 leaps #0 1 1 854 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." 855 def Nightrider checkride #0 #1 1 2 856 def Nightrider-Range rays #0 1 2 857 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." 858 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." 859 set Black_Pawn-Desc var White_Pawn-Desc 860 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 861 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 862 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 863 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 864 def White_Pawn-Promote var wprom 865 def Black_Pawn-Promote var bprom 866 sub White_Pawn from to 867 my newpiece 868 my newmove 869 my prom 870 verify > rank #to rank #from 871 verify <= distance #to #from #fps 872 if capture 873 verify checkleap #from #to 1 1 874 set ep false 875 elseif checkleap #from #to 1 1 and #ep 876 verify == filename var ep filename #to 877 verify < rankname var ep rankname #to 878 verify < rankname #to var bpr 879 capture #ep 880 set ep false 881 elseif > distance #to #from 1 882 verify == rankname #from #wpr 883 verify checkride #from #to 0 1 884 set ep #to 885 else 886 verify checkleap #from #to 0 1 887 set ep false 888 endif 889 set prom fn White_Pawn-Promote #to 890 if onboard where #to 0 #pzs 891 if != space #to $moved 892 set name alias const alias $moved 893 die "You may not promote a" #name "until it reaches the promotion zone." 894 endif 895 elseif onboard where #to 0 1 896 if == White_Pawn const alias space #to and count var prom 897 if not $answered and == mln $maxmln and not strstr thismove chr 59 898 if not match alias space #to var prom 899 push prom space #to 900 endif 901 askpromote #prom 902 endif 903 elseif not match space #to var prom and != White_Pawn const alias space #to 904 set name alias const alias $moved 905 set newname alias const alias space #to 906 set msg list "You may not promote your" #name "to a" join #newname ".
" 907 set msg str_replace "_" " " var msg 908 die #msg 909 endif 910 elseif count var prom 911 if == White_Pawn const alias space #to 912 if == count var prom 1 913 set newpiece alias list var prom 914 set pieceid realname #newpiece 915 set newmove join #newpiece "-dest" 916 add #pieceid $dest 917 appendmove #newmove 918 else 919 askpromote #prom 920 endif 921 elseif not match alias space #to var prom 922 set name alias const alias $moved 923 set newname alias const alias space #to 924 set msg list "You may not promote your" #name "to a" join #newname ".
" 925 set msg str_replace "_" " " var msg 926 die #msg 927 endif 928 else 929 set name alias const alias $moved 930 set msg list "You may not advance your" #name "to the last rank, because there is nothing you may promote it to." 931 set msg str_replace "_" " " var msg 932 die #msg 933 endif 934 set nopvc 0 935 return true 936 endsub 937 sub Black_Pawn from to 938 my newpiece, pieceid 939 my newmove 940 my prom 941 verify < rank #to rank #from 942 verify <= distance #to #from #fps 943 if capture 944 verify checkleap #from #to 1 1 945 set ep false 946 elseif checkleap #from #to 1 1 and #ep 947 verify == filename var ep filename #to 948 verify > rankname var ep rankname #to 949 verify > rankname #to var wpr 950 capture #ep 951 set ep false 952 elseif > distance #to #from 1 953 verify == rankname #from #bpr 954 verify checkride #from #to 0 1 955 set ep #to 956 else 957 verify checkleap #from #to 0 1 958 set ep false 959 endif 960 set prom fn Black_Pawn-Promote #to 961 if onboard where #to 0 neg #pzs 962 if != space #to $moved 963 set name alias const alias $moved 964 die "You may not promote a" #name "until it reaches the promotion zone." 965 endif 966 elseif onboard where #to 0 -1 967 if == Black_Pawn const alias space #to and count var prom 968 if not $answered and == mln $maxmln and not strstr thismove chr 59 969 push prom space #to 970 askpromote #prom 971 endif 972 elseif not match space #to var prom and != Black_Pawn const alias space #to 973 set name alias const alias $moved 974 set newname alias const alias space #to 975 set msg list "You may not promote your" #name "to a" join #newname ".
" 976 set msg str_replace "_" " " var msg 977 die #msg 978 endif 979 elseif count var prom 980 if == Black_Pawn const alias space #to 981 if == count var prom 1 982 set newpiece alias list var prom 983 set newmove join #newpiece "-dest" 984 set pieceid realname var newpiece 985 add #pieceid $dest 986 appendmove #newmove 987 else 988 askpromote #prom 989 endif 990 elseif not match alias space #to var prom 991 set name alias const alias $moved 992 set newname alias const alias space #to 993 set msg list "You may not promote your" #name "to a" join #newname ".
" 994 set msg str_replace "_" " " var msg 995 die #msg 996 endif 997 else 998 set name alias const alias $moved 999 set msg list "You may not advance your" #name "to the last rank, because there is nothing you may promote it to." 1000 set msg str_replace "_" " " var msg 1001 die #msg 1002 endif 1003 set nopvc 0 1004 return true 1005 endsub 1006 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." 1007 set Black_Quick_Pawn-Desc var White_Quick_Pawn-Desc 1008 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 1009 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 1010 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 1011 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 1012 def White_Quick_Pawn-Promote var wprom 1013 def Black_Quick_Pawn-Promote var bprom 1014 sub White_Quick_Pawn from to 1015 my newpiece 1016 my newmove 1017 my prom 1018 verify > rank #to rank #from 1019 verify <= distance #to #from #fps 1020 if capture 1021 verify checkleap #from #to 1 1 1022 set epf false 1023 set ep false 1024 elseif checkleap #from #to 1 1 and #ep 1025 verify == filename var ep filename #to 1026 verify < rankname var ep rankname #to 1027 verify < rankname #to rankname var epf 1028 capture #ep 1029 set epf false 1030 set ep false 1031 elseif > distance #to #from 1 1032 verify checkride #from #to 0 1 1033 set epf #from 1034 set ep #to 1035 else 1036 verify checkleap #from #to 0 1 1037 set epf false 1038 set ep false 1039 endif 1040 set prom fn White_Quick_Pawn-Promote #to 1041 if onboard where #to 0 #pzs 1042 if != space #to $moved 1043 set name alias const alias $moved 1044 die "You may not promote a" #name "from" $moved "to" {space #to} "until it reaches the promotion zone." 1045 endif 1046 elseif onboard where #to 0 1 1047 if == White_Quick_Pawn const alias space #to and count var prom 1048 if not $answered and == mln $maxmln and not strstr thismove chr 59 1049 if not match alias space #to var prom 1050 push prom space #to 1051 endif 1052 askpromote #prom 1053 endif 1054 elseif not match space #to var prom and != White_Quick_Pawn const alias space #to 1055 set name alias const alias $moved 1056 set newname alias const alias space #to 1057 set msg list "You may not promote your" #name "to a" join #newname ".
" 1058 set msg str_replace "_" " " var msg 1059 die #msg 1060 endif 1061 elseif count var prom 1062 if == White_Quick_Pawn const alias space #to 1063 if == count var prom 1 1064 set newpiece alias list var prom 1065 set pieceid realname #newpiece 1066 set newmove join #newpiece "-dest" 1067 add #pieceid $dest 1068 appendmove #newmove 1069 else 1070 askpromote #prom 1071 endif 1072 elseif not match alias space #to var prom 1073 set name alias const alias $moved 1074 set newname alias const alias space #to 1075 set msg list "You may not promote your" #name "to a" join #newname ".
" 1076 set msg str_replace "_" " " var msg 1077 die #msg 1078 endif 1079 else 1080 set name alias const alias $moved 1081 set msg list "You may not advance your" #name "to the last rank, because there is nothing you may promote it to." 1082 set msg str_replace "_" " " var msg 1083 die #msg 1084 endif 1085 set nopvc 0 1086 return true 1087 endsub 1088 sub Black_Quick_Pawn from to 1089 my newpiece, pieceid 1090 my newmove 1091 my prom 1092 verify < rank #to rank #from 1093 verify <= distance #to #from #fps 1094 if capture 1095 verify checkleap #from #to 1 1 1096 set ep false 1097 set epf false 1098 elseif checkleap #from #to 1 1 and #ep 1099 verify == filename var ep filename #to 1100 verify > rankname var ep rankname #to 1101 verify > rankname #to rankname var epf 1102 capture #ep 1103 set ep false 1104 set epf false 1105 elseif > distance #to #from 1 1106 verify checkride #from #to 0 1 1107 set ep #to 1108 set epf #from 1109 else 1110 verify checkleap #from #to 0 1 1111 set ep false 1112 set epf false 1113 endif 1114 set prom fn Black_Quick_Pawn-Promote #to 1115 if onboard where #to 0 neg #pzs 1116 if != space #to $moved 1117 set name alias const alias $moved 1118 die "You may not promote a" #name "until it reaches the promotion zone." 1119 endif 1120 elseif onboard where #to 0 -1 1121 if == Black_Quick_Pawn const alias space #to and count var prom 1122 if not $answered and == mln $maxmln and not strstr thismove chr 59 1123 push prom space #to 1124 askpromote #prom 1125 endif 1126 elseif not match space #to var prom and != Black_Quick_Pawn const alias space #to 1127 set name alias const alias $moved 1128 set newname alias const alias space #to 1129 set msg list "You may not promote your" #name "to a" join #newname ".
" 1130 set msg str_replace "_" " " var msg 1131 die #msg 1132 endif 1133 elseif count var prom 1134 if == Black_Quick_Pawn const alias space #to 1135 if == count var prom 1 1136 set newpiece alias list var prom 1137 set newmove join #newpiece "-dest" 1138 set pieceid realname var newpiece 1139 add #pieceid $dest 1140 appendmove #newmove 1141 else 1142 askpromote #prom 1143 endif 1144 elseif not match alias space #to var prom 1145 set name alias const alias $moved 1146 set newname alias const alias space #to 1147 set msg list "You may not promote your" #name "to a" join #newname ".
" 1148 set msg str_replace "_" " " var msg 1149 die #msg 1150 endif 1151 else 1152 set name alias const alias $moved 1153 set msg list "You may not advance your" #name "to the last rank, because there is nothing you may promote it to." 1154 set msg str_replace "_" " " var msg 1155 die #msg 1156 endif 1157 set nopvc 0 1158 return true 1159 endsub 1160 def Queen fn Bishop #0 #1 or fn Rook #0 #1 1161 def Queen-Range merge rays #0 1 0 rays #0 1 1 1162 set Queen-Desc "The %s may move as a Rook or a Bishop." 1163 def Rhino windingride #0 #1 1 0 1 1 or windingride #0 #1 0 1 1 1 1164 def Rhino-Range merge eval (windingrays #0 1 0 1 1) windingrays #0 0 1 1 1 1165 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." 1166 def Rook checkride #0 #1 1 0 1167 def Rook-Range rays #0 1 0 1168 set Rook-Desc "The %s may move any number of spaces in any vertical or horizontal direction until it reaches an occupied space." 1169 def Short_Rook checkride #0 #1 1 0 and <= distance #0 #1 4 1170 def Short_Rook-Range merge merge leaps #0 1 0 leaps #0 2 0 merge leaps #0 3 0 leaps #0 4 0 1171 set "The %s may move up to four spaces along its rank or file as a Rook." 1172 def White_Shogi_Knight checkaleap #0 #1 1 2 or checkaleap #0 #1 -1 2 1173 def White_Shogi_Knight-Range array where #0 1 2 where #0 -1 2 1174 set White_Shogi_Knight-Desc "The %s may leap to either space that is two ranks ahead and one file to the side." 1175 def Black_Shogi_Knight checkaleap #0 #1 1 -2 or checkaleap #0 #1 -1 -2 1176 def Black_Shogi_Knight-Range array where #0 1 -2 where #0 -1 -2 1177 set Black_Shogi_Knight-Desc "The %s may leap to either space that is two ranks ahead and one file to the side." 1178 def White_Shogi_Pawn checkaleap #0 #1 0 1 1179 def White_Shogi_Pawn-Range array where #0 0 1 1180 set White_Shogi_Pawn-Desc "The %s map move one space forward in the same file." 1181 def Black_Shogi_Pawn checkaleap #0 #1 0 -1 1182 def Black_Shogi_Pawn-Range array where #0 0 -1 1183 set Black_Shogi_Pawn-Desc "The %s map move one space forward in the same file." 1184 def White_Silver_General checkaleap #0 #1 0 1 or checkleap #0 #1 1 1 1185 def White_Silver_General-Range mergeall leaps #0 1 1 where #0 0 1 1186 set White_Silver_General-Desc "The %s may move one space in any diagonal direction or one space vertically foward." 1187 def Black_Silver_General checkaleap #0 #1 0 -1 or checkleap #0 #1 1 1 1188 def Black_Silver_General-Range mergeall leaps #0 1 1 where #0 0 -1 1189 set Black_Silver_General-Desc "The %s may move one space in any diagonal direction or one space vertically foward." 1190 def Squirrel fn Elephant #0 #1 or fn Dabbabah #0 #1 or fn Knight #0 #1 1191 def Squirrel-Range mergeall leaps #0 2 2 leaps #0 2 0 leaps #0 1 2 1192 set Squirrel-Desc "The %s may leap any non-adjacent space that is no more than two spaces away." 1193 def Spider fn Dabbabah #0 #1 or fn Elephant #0 #1 1194 def Spider-Range merge leaps #0 2 2 leaps #0 0 2 1195 set Spider-Desc "The %s may leap to any space that is two spaces away orthogonally or diagonally." 1196 def Spider-rider fn Dabbabahrider #0 #1 or fn Elephantrider #0 #1 1197 def Spider-rider-Range merge rays #0 2 2 rays #0 0 2 1198 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." 1199 def Squire checktwostep #0 #1 0 1 1 1 or checktwostep #0 #1 1 1 0 1 1200 def Squire-Range leaps #0 1 2 1201 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." 1202 def Unicorn fn Nightrider #0 #1 or fn Bishop #0 #1 1203 def Unicorn-Range merge rays #0 1 2 rays #0 1 1 1204 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." 1205 def Vao cond cond empty #0 capture (not empty #1) (checkhop #0 #1 1 1) (checkride #0 #1 1 1) and #1 1206 def Vao-Range rays #0 1 1 1207 set Vao-Desc "The %s may move diagonally as a Bishop, but it must hop over exactly one intervening piece when it captures." 1208 def Wazir checkleap #0 #1 1 0 1209 def Wazir-Range leaps #0 1 0 1210 set Wazir-Desc "The %s may move one space horizontally or vertically." 1211 def Wizard fn Ferz #0 #1 or fn Camel #0 #1 1212 def Wizard-Range merge leaps #0 1 1 leaps #0 1 3 1213 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." 1214 def Woody_Rook checkleap #0 #1 0 2 or checkleap #0 #1 0 1 1215 def Woody_Rook-Range merge leaps #0 0 1 leaps #0 0 2 1216 set Woody_Rook-Desc "The %s may leap one or two spaces orthogonally. It may pass over another piece when moving two spaces." 1217 def Zebra checkleap #0 #1 2 3 1218 def Zebra-Range leaps #0 2 3 1219 set Zebra-Desc "The %s may leap to any space that is 2 ranks and 3 files or 2 files and 3 ranks away." 1220 def Elephant_Ferz fn Ferz #0 #1 or fn Elephant #0 #1 1221 def Elephant_Ferz-Range merge leaps #0 2 2 leaps #0 1 1 1222 set Elephant_Ferz-Desc "The %s may leap one or two spaces diagonally. It may pass over another piece when moving two spaces." 1223 def Elephant_Wazir fn Wazir #0 #1 or fn Elephant #0 #1 1224 def Elephant_Wazir-Range merge leaps #0 2 2 leaps #0 1 0 1225 set Elephant_Wazir-Desc "The %s may move one space orthogonally, as a Wazir, or leap two spaces diagonally, as an Elephant." 1226 def Kylin fn Ferz #0 #1 or fn Dabbabah #0 #1 1227 def Kylin-Range mergeall leaps #0 1 1 leaps #0 2 0 1228 set Kylin-Desc "The %s may move one space diagonally, or it may leap 2 spaces orthogonally, passing over any pieces in the way." 1229 def Half_Duck fn Ferz #0 #1 or fn Dabbabah #0 #1 or checkleap #0 #1 3 0 1230 def Half_Duck-Range mergeall leaps #0 1 1 leaps #0 2 0 leaps #0 3 0 1231 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." 1232 def Knight_Wazir fn Knight #0 #1 or fn Wazir #0 #1 1233 def Knight_Wazir-Range merge leaps #0 1 2 leaps #0 1 0 1234 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." 1235 def Frog fn Ferz #0 #1 or checkleap #0 #1 3 0 1236 def Frog-Range merge leaps #0 1 1 leaps #0 3 0 1237 set Frog-Desc "The %s may move one space diagonally or directly leap 3 spaces orthogonally." 1238 def Buffalo fn Knight #0 #1 or fn Camel #0 #1 or fn Zebra #0 #1 1239 def Buffalo-Range mergeall leaps #0 1 2 leaps #0 1 3 leaps #0 2 3 1240 set Buffalo-Desc "The %s Buffalo may leap (1, 2) as a Knight, (1, 3) as a Camel, or (2, 3) as a Zebra." 1241 def @ false 1242 sub attacked start finish 1243 my from piece actual 1244 local movetype 1245 set movetype MOVE 1246 if empty #start 1247 set actual true 1248 move #finish #start 1249 add $old #finish 1250 endif 1251 if isupper space #start 1252 def enemies onlylower 1253 else 1254 def enemies onlyupper 1255 endif 1256 for (from piece) fn enemies 1257 if fn const alias #piece #from #to 1258 if #actual 1259 move #start #finish 1260 endif 1261 return #from 1262 endif 1263 next 1264 if #actual 1265 move #start #finish 1266 endif 1267 return false 1268 endsub 1269 sub fission-attacked start finish 1270 my from piece p1 p2 1271 local movetype 1272 set p1 space #start 1273 set p2 space #finish 1274 set movetype CHECK 1275 if isupper #p1 1276 def enemies onlylower 1277 else 1278 def enemies onlyupper 1279 endif 1280 empty #finish 1281 for (from piece) fn enemies 1282 if fn const alias #piece #from #start 1283 add #p2 #finish 1284 return #from 1285 endif 1286 next 1287 add #p2 #finish 1288 return false 1289 endsub 1290 sub checked king 1291 my from piece 1292 local movetype 1293 set movetype CHECK 1294 if isupper cond empty var king $moved space var king 1295 def enemies onlylower 1296 else 1297 def enemies onlyupper 1298 endif 1299 for (from piece) fn enemies 1300 if fn const alias #piece #from var king and isfunc const alias #piece 1301 return #from 1302 endif 1303 next 1304 return false 1305 endsub 1306 def checked anytrue lambda (fn const alias #0 var key var king) cond isupper space var king (onlylower) (onlyupper) =movetype CHECK =king 1307 def threatened anytrue lambda (fn const alias space #0 #0 var king) elem var king threats =movetype CHECK =king 1308 sub uncheckedpath start finish 1309 my from to piece kingpos 1310 local movetype 1311 set movetype CHECK 1312 if empty #finish 1313 set kingpos #start 1314 else 1315 set kingpos #finish 1316 endif 1317 if isupper space #kingpos 1318 def enemies onlylower 1319 else 1320 def enemies onlyupper 1321 endif 1322 for to path #start #finish 1323 move #kingpos #to 1324 for (from piece) fn enemies 1325 if fn const alias #piece #from #to 1326 move #to #kingpos 1327 return false 1328 endif 1329 next 1330 move #to #kingpos 1331 next 1332 return true 1333 endif 1334 sub uncheckedknightleap start finish 1335 my from to piece kingpos kingpiece checkedpaths 1336 local movetype 1337 set movetype CHECK 1338 if empty #start 1339 set kingpos #finish 1340 else 1341 set kingpos #start 1342 endif 1343 if isupper space #kingpos 1344 def enemies onlylower 1345 else 1346 def enemies onlyupper 1347 endif 1348 set kingpiece space #kingpos 1349 set avenues merge intersection leaps #start 1 0 leaps #finish 1 1 intersection leaps #start 1 1 leaps #finish 1 0 1350 set checkdpaths 0 1351 for to #avenues 1352 if empty #to 1353 move #kingpos #to 1354 else 1355 empty #kingpos 1356 endif 1357 for (from piece) fn enemies 1358 if fn const alias #piece #from #to 1359 inc checkedpaths 1360 break 1361 endif 1362 next 1363 if == space #to #kingpiece 1364 move #to #kingpos 1365 else 1366 add #kingpiece #kingpos 1367 endif 1368 if == checkedpaths 0 1369 break 1370 endif 1371 next 1372 return < var checkedpaths 2 1373 endif 1374 sub castle from to 1375 local coord RPOS RDEST xdir 1376 if not flag #from 1377 die A King may not castle after it moves. 1378 endif 1379 if capture 1380 die A King may not castle to an occupied space. 1381 endif 1382 set xdir sign minus file #to file #from 1383 if not checkaride #from #to #xdir 0 1384 die A King may not castle across any occupied space. 1385 endif 1386 set coord #to 1387 do 1388 set coord where #coord #xdir 0 1389 if flag #coord 1390 break 1391 elseif not onboard #coord 1392 die No piece was found to castle with. 1393 elseif not empty #coord 1394 die The King cannot castle with the piece at #coord 1395 endif 1396 loop 1397 set RPOS #coord 1398 move #to #from 1399 if sub checked #from 1400 die A King may not castle out of check. 1401 endif 1402 store 1403 for coord path #from #to 1404 move #from #coord 1405 if sub checked #coord 1406 die A King may not castle through check. 1407 endif 1408 restore 1409 next 1410 move #from #to 1411 set RDEST where #to neg #xdir 0 1412 move #RPOS #RDEST 1413 return true 1414 endsub 1415 sub castlepos from to 1416 local coord RPOS RDEST xdir safe 1417 verify flag #from 1418 verify empty #to 1419 set xdir sign minus file #to file #from 1420 verify checkaride #from #to #xdir 0 1421 verify not sub checked #from 1422 set coord #to 1423 do 1424 set coord where #coord #xdir 0 1425 if flag #coord 1426 break 1427 endif 1428 verify onboard #coord 1429 verify empty #coord 1430 loop 1431 verify flag #coord 1432 set RPOS #coord 1433 store 1434 for coord path #from #to 1435 move #from #coord 1436 set safe not sub checked #coord 1437 restore 1438 verify #safe 1439 next 1440 move #from #to 1441 set RDEST where #to neg #xdir 0 1442 move #RPOS #RDEST 1443 set safe not sub checked #to 1444 restore 1445 return #safe 1446 endsub 1447 sub castle2 kingfrom kingto rookfrom rookto 1448 local coord xdir king rook 1449 if not flag #kingfrom 1450 die A King may not castle after it moves. 1451 endif 1452 if not flag #rookfrom 1453 die A King may not castle with a piece that has already moved. 1454 endif 1455 if not match @ $lastcaptured $prevcaptured 1456 die Castling to an occupied space is not allowed. 1457 endif 1458 if empty #kingto 1459 die There is nothing on #kingto. Did you move a piece there and then move it away? 1460 endif 1461 if empty #rookto 1462 die There is nothing on #rookto. Did you move a piece there and then move it away? 1463 endif 1464 set king space #kingto 1465 set rook space #rookto 1466 if == #king #rook 1467 die "Castling must be between different pieces. These two are both {#king}. What happened?" 1468 endif 1469 empty #kingto 1470 empty #rookto 1471 add #king #kingfrom 1472 add #rook #rookfrom 1473 set xdir sign minus file #kingto file #kingfrom 1474 if not checkaride #kingfrom #kingto #xdir 0 1475 die A King may not castle across any occupied space. 1476 endif 1477 if not checkaride #rookto #rookfrom #xdir 0 1478 die A Rook may not castle across an occupied space. 1479 endif 1480 if sub checked #kingfrom 1481 die A King may not castle out of check. 1482 endif 1483 store 1484 for coord path #kingfrom #kingto 1485 move #kingfrom #coord 1486 if sub checked #coord 1487 die A King may not castle through check. 1488 endif 1489 restore 1490 next 1491 empty #kingfrom 1492 empty #rookfrom 1493 add #king #kingto 1494 add #rook #rookto 1495 unsetflag #kingfrom #rookfrom 1496 if isupper space #kingto 1497 set Kpos #kingto 1498 else 1499 set kpos #kingto 1500 endif 1501 return true 1502 endsub 1503 sub castlepos2 kingfrom kingto rookfrom rookto 1504 echo "Calling castlepos2" #kingfrom #kingto #rookfrom #rookto 1505 local coord xdir safe 1506 verify flag #kingfrom and flag #rookfrom 1507 echo "Verified flags" 1508 verify empty #kingto or == #kingto #rookfrom 1509 verify empty #rookto or == #rookto #kingfrom 1510 echo "Verified empty destinations" 1511 set xdir sign minus file #kingto file #kingfrom 1512 echo "xdir is {#xdir}" 1513 verify checkride #kingfrom #kingto #xdir 0 1514 echo "Verified checkride {#kingfrom} {#kingto} {#xdir} 0" 1515 verify checkride #rookto #rookfrom #xdir 0 1516 echo "Verified checkride {#kingto} {#kingfrom} {#xdir} 0" 1517 verify not sub checked #kingfrom 1518 echo "Verified not checked" 1519 store 1520 for coord path #kingfrom #kingto 1521 move #kingfrom #coord 1522 set safe not sub checked #coord 1523 restore 1524 verify #safe 1525 next 1526 move #kingfrom #kingto 1527 move #rookfrom #rookto 1528 set safe not sub checked #kingto 1529 restore 1530 return #safe 1531 endsub 1532 sub stalemated kingpos 1533 store 1534 local cspaces friend friends from king piece to movetype np prom promfn 1535 set movetype MOVE 1536 set king alias space #kingpos 1537 if hasupper #king 1538 set friends lambda (onlyupper) 1539 set free lambda (haslower #0 or not hasupper #0) 1540 set pzone lambda (not onboard where #0 0 var pzs) 1541 set cspaces var wcastle 1542 set prom var wprom 1543 else 1544 set friends lambda (onlylower) 1545 set free lambda (hasupper #0 or not haslower #0) 1546 set pzone lambda (not onboard where #0 0 neg var pzs) 1547 set cspaces var bcastle 1548 set prom var bprom 1549 endif 1550 store 1551 for (from piece) fn #friends 1552 set af alias #from 1553 for to fn join const alias #piece "-Range" #from 1554 set at alias #to 1555 if fn const alias #piece #from #to and fn #free alias space #to and onboard #to 1556 set ap alias #piece 1557 move #from #to 1558 if not sub checked cond == #from #kingpos #to #kingpos 1559 set promfn join const alias #piece "-Promote" 1560 if fn #pzone #to and match #piece #promotable 1561 if > count var prom 0 1562 for np var prom 1563 setlegal "{#ap} {#af}-{#at}; {#np}-{#at}" 1564 next 1565 endif 1566 elseif fn #pzone #to and isfunc var promfn 1567 set prom fn var promfn #to 1568 if > count var prom 0 1569 for np var prom 1570 setlegal "{#ap} {#af}-{#at}; {#np}-{#at}" 1571 next 1572 endif 1573 elseif fn #pzone #to and match #piece #promotable 1574 if > count var prom 0 1575 for np var prom 1576 setlegal "{#ap} {#af}-{#at}; {#np}-{#at}" 1577 next 1578 endif 1579 else 1580 setlegal "{#ap} {#af}-{#at}" 1581 endif 1582 endif 1583 endif 1584 restore 1585 next 1586 next 1587 if > count var cspaces 0 1588 for to var cspaces 1589 if sub castlepos #kingpos #to 1590 setlegal "{#king} {#kingpos}-{#to}" 1591 endif 1592 next 1593 endif 1594 setsystem autorules sub describe_rules 1595 return cond count system legalmoves false true 1596 endsub 1597 sub stalemated-quick kingpos 1598 store 1599 local checked checkpos cspaces enemies friend friends from in king piece threats to movetype np prom promfn 1600 set movetype MOVE 1601 set king alias space #kingpos 1602 if hasupper #king 1603 set friends lambda (onlyupper) 1604 set enemies lambda (onlylower) 1605 set free lambda (haslower #0 or not hasupper #0) 1606 set pzone lambda (not onboard where #0 0 var pzs) 1607 set cspaces var wcastle 1608 set prom var wprom 1609 else 1610 set friends lambda (onlylower) 1611 set enemies lambda (onlyupper) 1612 set free lambda (hasupper #0 or not haslower #0) 1613 set pzone lambda (not onboard where #0 0 neg var pzs) 1614 set cspaces var bcastle 1615 set prom var bprom 1616 endif 1617 set krange merge fn join const alias space #kingpos "-Range" #kingpos #kingpos 1618 set threats () 1619 for to #krange 1620 set threats.{#to} () 1621 next 1622 for (from piece) fn #enemies 1623 set in intersection var krange fn join const alias var piece "-Range" var from 1624 for to #in 1625 push threats.{#to} #from 1626 next 1627 next 1628 store 1629 for (from piece) fn #friends 1630 set af alias #from 1631 for to fn join const alias #piece "-Range" #from 1632 set at alias #to 1633 if fn const alias #piece #from #to and fn #free alias space #to and onboard #to 1634 set ap alias #piece 1635 set checkpos cond == #from #kingpos #to #kingpos 1636 set checked false 1637 if count elem var checkpos threats 1638 move #from #to 1639 set checked fn threatened #checkpos 1640 restore 1641 endif 1642 if not #checked 1643 set promfn join const alias #piece "-Promote" 1644 if fn #pzone #to and match #piece #promotable 1645 if > count var prom 0 1646 for np var prom 1647 setlegal "{#ap} {#af}-{#at}; {#np}-{#at}" 1648 next 1649 endif 1650 elseif fn #pzone #to and isfunc var promfn 1651 set prom fn var promfn #to 1652 if > count var prom 0 1653 for np var prom 1654 setlegal "{#ap} {#af}-{#at}; {#np}-{#at}" 1655 next 1656 endif 1657 elseif fn #pzone #to and match #piece #promotable 1658 if > count var prom 0 1659 for np var prom 1660 setlegal "{#ap} {#af}-{#at}; {#np}-{#at}" 1661 next 1662 endif 1663 else 1664 setlegal "{#ap} {#af}-{#at}" 1665 endif 1666 endif 1667 endif 1668 restore 1669 next 1670 next 1671 if > count var cspaces 0 1672 for to var cspaces 1673 if sub castlepos #kingpos #to 1674 setlegal "{#king} {#kingpos}-{#to}" 1675 endif 1676 next 1677 endif 1678 setsystem autorules sub describe_rules 1679 return cond count system legalmoves false true 1680 endsub 1681 sub stalemated2 kingpos 1682 store 1683 local cspaces friend friends from piece to movetype 1684 set movetype MOVE 1685 if isupper space #kingpos 1686 set friends (onlyupper) 1687 set friend (isupper #0) 1688 set cspaces var wcastle 1689 else 1690 set friends (onlylower) 1691 set friend (islower #0) 1692 set cspaces var bcastle 1693 endif 1694 set royal space var kingpos 1695 store 1696 for (from piece) fn #friends 1697 for to fn join const alias #piece "-Range" #from 1698 if fn const alias #piece #from #to and not fn #friend space #to and onboard #to 1699 move #from #to 1700 if not sub checked cond == #from #kingpos #to #kingpos 1701 set ap alias #piece 1702 setlegal "{#ap} {#from}-{#to}" 1703 endif 1704 endif 1705 restore 1706 next 1707 next 1708 if > count var cspaces 0 and flag #kingpos 1709 for mvs var cspaces 1710 if sub castlepos2 #mvs.0 #mvs.1 #mvs.2 #mvs.3 and == #kingpos #mvs.0 1711 set pk alias space #mvs.0 1712 set pr alias space #mvs.2 1713 setlegal "{#pk} {#mvs.0}-{#mvs.1}; {#pr} {#mvs.2}-{#mvs.3}" 1714 endif 1715 next 1716 endif 1717 setsystem autorules sub describe_rules 1718 return cond count system legalmoves false true 1719 endsub 1720 sub fusion-stalemated kingpos 1721 store 1722 local cspaces friend friends from piece to movetype mv ss 1723 set movetype MOVE 1724 set ss join chr 47 chr 47 1725 if isupper space #kingpos 1726 set friends (onlyupper) 1727 set friend (isupper #0) 1728 set cspaces var wcastle 1729 else 1730 set friends (onlylower) 1731 set friend (islower #0) 1732 set cspaces var bcastle 1733 endif 1734 set royal space var kingpos 1735 store 1736 set kp #kingpos 1737 for (from piece) fn #friends 1738 set ap alias #piece 1739 for to fn join const #ap "-Range" #from 1740 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 1741 move #from #to 1742 if match #ap K KR KB KN k kr kb kn 1743 set kp #to 1744 endif 1745 if not sub checked #kp 1746 setlegal "{#ap} {#from}-{#to}" 1747 endif 1748 restore 1749 set kp #kingpos 1750 endif 1751 if not sub checked #from and empty #to and == strlen alias #piece 2 1752 set compound alias #piece 1753 set simple1 leftstr #compound 1 1754 set simple2 rightstr #compound 1 1755 if != not fn #friend space #to and fn const alias #simple1 #from #to 1756 add #simple1 #to 1757 add #simple2 #from 1758 if match #simple1 K k 1759 set kp #to 1760 endif 1761 if not sub checked #kp 1762 setlegal "{#simple1} {#from}-{#to}; {#ss} {#simple2}-{#from}" 1763 endif 1764 restore 1765 set kp #kingpos 1766 endif 1767 if != not fn #friend space #to and fn const alias #simple2 #from #to 1768 add #simple2 #to 1769 add #simple1 #from 1770 if match #simple1 K k 1771 set kp #from 1772 endif 1773 if not sub checked #kp 1774 setlegal "{#simple2} {#from}-{#to}; {#ss} {#simple1}-{#from}" 1775 endif 1776 restore 1777 set kp #kingpos 1778 endif 1779 endif 1780 next 1781 next 1782 if > count var cspaces 0 1783 for to var cspaces 1784 if sub castlepos #kingpos #to 1785 setlegal (#kingpos #to) 1786 endif 1787 next 1788 endif 1789 setsystem autorules sub describe_rules 1790 return cond count system legalmoves false true 1791 endsub 1792 sub describe_rules 1793 my c piecenames notation values val id ref rules desc name codename rangefn 1794 set c.0 join filename 0 rankname 0 1795 set c.1 join filename >> lastfile 1 rankname 1 1796 set c.2 join filename inc >> lastfile 1 rankname 1 1797 set c.3 join filename >> lastfile 1 rankname inc >> lastrank 1 1798 set c.4 join filename inc >> lastfile 1 rankname >> lastrank 1 1799 set c.5 join filename >> lastfile 1 rankname dec lastrank 1800 set c.6 join filename inc >> lastfile 1 rankname dec lastrank 1801 set c.7 join filename lastfile rankname lastrank 1802 foreach p keys $pieces 1803 if isconst alias #p 1804 set codename const alias #p 1805 set name alias #codename 1806 set notation.{#name} alias #p 1807 if match #codename const alias space #kpos const alias space #Kpos 1808 set values.{#name} * 8 count spaces 1809 else 1810 set rangefn join #codename "-Range" 1811 set values.{#name} sum lambda (count fn #rangefn #0) #c 1812 endif 1813 endif 1814 next 1815 set values reverse asort #values 1816 set rules "
" 1817 foreach (name val) #values 1818 set codename realname #name 1819 if == null var #codename 1820 set codename #name 1821 endif 1822 set ref join #codename "-Desc" 1823 set desc str_replace "%s" #name var #ref 1824 set desc str_replace "_" " " #desc 1825 set id realname #notation.{#name} 1826 set rules join #rules "
[pc {#id} {#name}]{#desc}[/pc]
" 1827 next 1828 set rules join #rules "
" 1829 return #rules 1830 endsub 1831 sub findmates side 1832 local enemyking king mates moves mv 1833 if match #side 1 white White first 1834 set king #Kpos 1835 set enemyking #kpos 1836 else 1837 set king #kpos 1838 set enemyking #Kpos 1839 endif 1840 set mates () 1841 ban none 1842 setsystem maxmove 0 1843 store main 1844 setsystem legalmoves () 1845 if not sub stalemated #king 1846 set lglmvs $legalmoves 1847 foreach move #lglmvs 1848 set moves explode chr 59 #move 1849 foreach mv #moves 1850 set mv trim #mv 1851 eval "MOVE: {#mv}" 1852 next 1853 if sub checked #enemyking 1854 setsystem legalmoves () 1855 if sub stalemated #enemyking 1856 push mates #move 1857 endif 1858 endif 1859 restore main 1860 next 1861 endif 1862 setsystem legalmoves #mates 1863 endsub 1864 endlib

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] => 1 [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 g3-g5 [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-f5 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 2 ) [3] => MoveLine Object ( [movenum] => 4 [move] => p e6-f5 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 2 ) [4] => MoveLine Object ( [movenum] => 5 [move] => N i2-h4 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 3 ) [5] => MoveLine Object ( [movenum] => 6 [move] => w d11-e8 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 3 ) [6] => MoveLine Object ( [movenum] => 7 [move] => R j1-f1 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 4 ) [7] => MoveLine Object ( [movenum] => 8 [move] => w e8-d5 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 4 ) [8] => MoveLine Object ( [movenum] => 9 [move] => Q e2-h5 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 5 ) [9] => MoveLine Object ( [movenum] => 10 [move] => w d5-c2 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 5 ) [10] => MoveLine Object ( [movenum] => 11 [move] => C e0-c2 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 6 ) [11] => MoveLine Object ( [movenum] => 12 [move] => n i9-g7 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 6 ) [12] => MoveLine Object ( [movenum] => 13 [move] => Q h5-i4 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 7 ) [13] => MoveLine Object ( [movenum] => 14 [move] => p i8-i7 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 7 ) [14] => MoveLine Object ( [movenum] => 15 [move] => R a1-e1 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 8 ) [15] => MoveLine Object ( [movenum] => 16 [move] => b h9-i8 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 8 ) [16] => MoveLine Object ( [movenum] => 17 [move] => B h2-b8 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 9 ) [17] => MoveLine Object ( [movenum] => 18 [move] => p c8-c7 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 9 ) [18] => MoveLine Object ( [movenum] => 19 [move] => B b8-c9 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 10 ) [19] => MoveLine Object ( [movenum] => 20 [move] => c e11-c9 [level] => 0 [comment] => [length] => 14 [newturn] => [turn] => 10 ) [20] => MoveLine Object ( [movenum] => 21 [move] => K f2-i1 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 11 ) [21] => MoveLine Object ( [movenum] => 22 [move] => c c9-e7 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 11 ) [22] => MoveLine Object ( [movenum] => 23 [move] => P e3-e4 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 12 ) [23] => MoveLine Object ( [movenum] => 24 [move] => p f5-e4 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 12 ) [24] => MoveLine Object ( [movenum] => 25 [move] => R e1-e4 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 13 ) [25] => MoveLine Object ( [movenum] => 26 [move] => r j10-f10 [level] => 0 [comment] => [length] => 15 [newturn] => [turn] => 13 ) [26] => MoveLine Object ( [movenum] => 27 [move] => P d3-d5 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 14 ) [27] => MoveLine Object ( [movenum] => 28 [move] => q e9-e8 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 14 ) [28] => MoveLine Object ( [movenum] => 29 [move] => Q i4-e8 [level] => 0 [comment] => // - Check! - [length] => 25 [newturn] => 1 [turn] => 15 ) [29] => MoveLine Object ( [movenum] => 30 [move] => d d9-e8 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 15 ) [30] => MoveLine Object ( [movenum] => 31 [move] => G g2-g3 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 16 ) [31] => MoveLine Object ( [movenum] => 32 [move] => k f9-i10 [level] => 0 [comment] => [length] => 14 [newturn] => [turn] => 16 ) [32] => MoveLine Object ( [movenum] => 33 [move] => D d2-e1 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 17 ) [33] => MoveLine Object ( [movenum] => 34 [move] => b i8-e4 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 17 ) [34] => MoveLine Object ( [movenum] => 35 [move] => C c2-e4 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 18 ) [35] => MoveLine Object ( [movenum] => 36 [move] => c e7-g5 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 18 ) [36] => MoveLine Object ( [movenum] => 37 [move] => G g3-h1 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 19 ) [37] => MoveLine Object ( [movenum] => 38 [move] => c g5-i5 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 19 ) [38] => MoveLine Object ( [movenum] => 39 [move] => C e4-c6 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 20 ) [39] => MoveLine Object ( [movenum] => 40 [move] => d e8-c9 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 20 ) [40] => MoveLine Object ( [movenum] => 41 [move] => W d0-e3 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 21 ) [41] => MoveLine Object ( [movenum] => 42 [move] => c h11-f9 [level] => 0 [comment] => [length] => 14 [newturn] => [turn] => 21 ) [42] => MoveLine Object ( [movenum] => 43 [move] => N b2-d4 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 22 ) [43] => MoveLine Object ( [movenum] => 44 [move] => j f11-d9 [level] => 0 [comment] => [length] => 14 [newturn] => [turn] => 22 ) [44] => MoveLine Object ( [movenum] => 45 [move] => W e3-f6 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 23 ) [45] => MoveLine Object ( [movenum] => 46 [move] => g g9-j7 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 23 ) [46] => MoveLine Object ( [movenum] => 47 [move] => W f6-i5 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 24 ) [47] => MoveLine Object ( [movenum] => 48 [move] => g j7-i5 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 24 ) [48] => MoveLine Object ( [movenum] => 49 [move] => P j3-j4 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 25 ) [49] => MoveLine Object ( [movenum] => 50 [move] => g i5-h7 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 25 ) [50] => MoveLine Object ( [movenum] => 51 [move] => K i1-i2 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 26 ) [51] => MoveLine Object ( [movenum] => 52 [move] => w g11-d10 [level] => 0 [comment] => [length] => 15 [newturn] => [turn] => 26 ) [52] => MoveLine Object ( [movenum] => 53 [move] => D e1-d3 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 27 ) [53] => MoveLine Object ( [movenum] => 54 [move] => w d10-e7 [level] => 0 [comment] => [length] => 14 [newturn] => [turn] => 27 ) [54] => MoveLine Object ( [movenum] => 55 [move] => W g0-d1 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 28 ) [55] => MoveLine Object ( [movenum] => 56 [move] => w e7-d4 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 28 ) [56] => MoveLine Object ( [movenum] => 57 [move] => P c3-d4 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 29 ) [57] => MoveLine Object ( [movenum] => 58 [move] => d c9-b3 [level] => 0 [comment] => // - Check! - [length] => 27 [newturn] => [turn] => 29 ) [58] => MoveLine Object ( [movenum] => 59 [move] => K i2-i1 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 30 ) [59] => MoveLine Object ( [movenum] => 60 [move] => c f9-f7 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 30 ) [60] => MoveLine Object ( [movenum] => 61 [move] => W d1-e4 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 31 ) [61] => MoveLine Object ( [movenum] => 62 [move] => d b3-a7 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 31 ) [62] => MoveLine Object ( [movenum] => 63 [move] => C c6-e6 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 32 ) [63] => MoveLine Object ( [movenum] => 64 [move] => n b9-b6 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 32 ) [64] => MoveLine Object ( [movenum] => 65 [move] => C e6-g8 [level] => 0 [comment] => // - Check! - [length] => 25 [newturn] => 1 [turn] => 33 ) [65] => MoveLine Object ( [movenum] => 66 [move] => k i10-h9 [level] => 0 [comment] => [length] => 14 [newturn] => [turn] => 33 ) [66] => MoveLine Object ( [movenum] => 67 [move] => C g8-g6 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 34 ) [67] => MoveLine Object ( [movenum] => 68 [move] => n b6-d5 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 34 ) [68] => MoveLine Object ( [movenum] => 69 [move] => R f1-f7 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 35 ) [69] => MoveLine Object ( [movenum] => 70 [move] => g h7-e3 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 35 ) [70] => MoveLine Object ( [movenum] => 71 [move] => G h1-e5 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 36 ) [71] => MoveLine Object ( [movenum] => 72 [move] => j d9-e9 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 36 ) [72] => MoveLine Object ( [movenum] => 73 [move] => R f7-e7 [level] => 0 [comment] => // - Check! - [length] => 25 [newturn] => 1 [turn] => 37 ) [73] => MoveLine Object ( [movenum] => 74 [move] => resign [level] => 0 [comment] => // - Aurelian Florea has resigned. - [length] => 49 [newturn] => [turn] => 37 ) )

allmoves

Array ( [0] => moveindex 73;MOVE: resign;postauto2 [1] => moveindex 72;MOVE: R f7-e7;postauto1 [2] => moveindex 71;MOVE: j d9-e9;postauto2 [3] => moveindex 70;MOVE: G h1-e5;postauto1 [4] => moveindex 69;MOVE: g h7-e3;postauto2 [5] => moveindex 68;MOVE: R f1-f7;postauto1 [6] => moveindex 67;MOVE: n b6-d5;postauto2 [7] => moveindex 66;MOVE: C g8-g6;postauto1 [8] => moveindex 65;MOVE: k i10-h9;postauto2 [9] => moveindex 64;MOVE: C e6-g8;postauto1 [10] => moveindex 63;MOVE: n b9-b6;postauto2 [11] => moveindex 62;MOVE: C c6-e6;postauto1 [12] => moveindex 61;MOVE: d b3-a7;postauto2 [13] => moveindex 60;MOVE: W d1-e4;postauto1 [14] => moveindex 59;MOVE: c f9-f7;postauto2 [15] => moveindex 58;MOVE: K i2-i1;postauto1 [16] => moveindex 57;MOVE: d c9-b3;postauto2 [17] => moveindex 56;MOVE: P c3-d4;postauto1 [18] => moveindex 55;MOVE: w e7-d4;postauto2 [19] => moveindex 54;MOVE: W g0-d1;postauto1 [20] => moveindex 53;MOVE: w d10-e7;postauto2 [21] => moveindex 52;MOVE: D e1-d3;postauto1 [22] => moveindex 51;MOVE: w g11-d10;postauto2 [23] => moveindex 50;MOVE: K i1-i2;postauto1 [24] => moveindex 49;MOVE: g i5-h7;postauto2 [25] => moveindex 48;MOVE: P j3-j4;postauto1 [26] => moveindex 47;MOVE: g j7-i5;postauto2 [27] => moveindex 46;MOVE: W f6-i5;postauto1 [28] => moveindex 45;MOVE: g g9-j7;postauto2 [29] => moveindex 44;MOVE: W e3-f6;postauto1 [30] => moveindex 43;MOVE: j f11-d9;postauto2 [31] => moveindex 42;MOVE: N b2-d4;postauto1 [32] => moveindex 41;MOVE: c h11-f9;postauto2 [33] => moveindex 40;MOVE: W d0-e3;postauto1 [34] => moveindex 39;MOVE: d e8-c9;postauto2 [35] => moveindex 38;MOVE: C e4-c6;postauto1 [36] => moveindex 37;MOVE: c g5-i5;postauto2 [37] => moveindex 36;MOVE: G g3-h1;postauto1 [38] => moveindex 35;MOVE: c e7-g5;postauto2 [39] => moveindex 34;MOVE: C c2-e4;postauto1 [40] => moveindex 33;MOVE: b i8-e4;postauto2 [41] => moveindex 32;MOVE: D d2-e1;postauto1 [42] => moveindex 31;MOVE: k f9-i10;postauto2 [43] => moveindex 30;MOVE: G g2-g3;postauto1 [44] => moveindex 29;MOVE: d d9-e8;postauto2 [45] => moveindex 28;MOVE: Q i4-e8;postauto1 [46] => moveindex 27;MOVE: q e9-e8;postauto2 [47] => moveindex 26;MOVE: P d3-d5;postauto1 [48] => moveindex 25;MOVE: r j10-f10;postauto2 [49] => moveindex 24;MOVE: R e1-e4;postauto1 [50] => moveindex 23;MOVE: p f5-e4;postauto2 [51] => moveindex 22;MOVE: P e3-e4;postauto1 [52] => moveindex 21;MOVE: c c9-e7;postauto2 [53] => moveindex 20;MOVE: K f2-i1;postauto1 [54] => moveindex 19;MOVE: c e11-c9;postauto2 [55] => moveindex 18;MOVE: B b8-c9;postauto1 [56] => moveindex 17;MOVE: p c8-c7;postauto2 [57] => moveindex 16;MOVE: B h2-b8;postauto1 [58] => moveindex 15;MOVE: b h9-i8;postauto2 [59] => moveindex 14;MOVE: R a1-e1;postauto1 [60] => moveindex 13;MOVE: p i8-i7;postauto2 [61] => moveindex 12;MOVE: Q h5-i4;postauto1 [62] => moveindex 11;MOVE: n i9-g7;postauto2 [63] => moveindex 10;MOVE: C e0-c2;postauto1 [64] => moveindex 9;MOVE: w d5-c2;postauto2 [65] => moveindex 8;MOVE: Q e2-h5;postauto1 [66] => moveindex 7;MOVE: w e8-d5;postauto2 [67] => moveindex 6;MOVE: R j1-f1;postauto1 [68] => moveindex 5;MOVE: w d11-e8;postauto2 [69] => moveindex 4;MOVE: N i2-h4;postauto1 [70] => moveindex 3;MOVE: p e6-f5;postauto2 [71] => moveindex 2;MOVE: P f3-f5;postauto1 [72] => moveindex 1;MOVE: p e8-e6;postauto2 [73] => moveindex 0;MOVE: P g3-g5;postauto1 )

movelist

1. P g3-g5 1... p e8-e6 2. P f3-f5 2... p e6-f5 3. N i2-h4 3... w d11-e8 4. R j1-f1 4... w e8-d5 5. Q e2-h5 5... w d5-c2 6. C e0-c2 6... n i9-g7 7. Q h5-i4 7... p i8-i7 8. R a1-e1 8... b h9-i8 9. B h2-b8 9... p c8-c7 10. B b8-c9 10... c e11-c9 11. K f2-i1 11... c c9-e7 12. P e3-e4 12... p f5-e4 13. R e1-e4 13... r j10-f10 14. P d3-d5 14... q e9-e8 15. Q i4-e8 // - Check! - 15... d d9-e8 16. G g2-g3 16... k f9-i10 17. D d2-e1 17... b i8-e4 18. C c2-e4 18... c e7-g5 19. G g3-h1 19... c g5-i5 20. C e4-c6 20... d e8-c9 21. W d0-e3 21... c h11-f9 22. N b2-d4 22... j f11-d9 23. W e3-f6 23... g g9-j7 24. W f6-i5 24... g j7-i5 25. P j3-j4 25... g i5-h7 26. K i1-i2 26... w g11-d10 27. D e1-d3 27... w d10-e7 28. W g0-d1 28... w e7-d4 29. P c3-d4 29... d c9-b3 // - Check! - 30. K i2-i1 30... c f9-f7 31. W d1-e4 31... d b3-a7 32. C c6-e6 32... n b9-b6 33. C e6-g8 // - Check! - 33... k i10-h9 34. C g8-g6 34... n b6-d5 35. R f1-f7 35... g h7-e3 36. G h1-e5 36... j d9-e9 37. R f7-e7 // - Check! - 37... 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 [coin1] => 1 [coin2] => 1 [z] => Sangoma [Z] => Sangoma )