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

mline

Array ( [0] => MoveLine Object ( [movenum] => 0 [move] => [level] => 0 [comment] => [length] => 0 [newturn] => [turn] => 0 ) )

allmoves

Array ( )

movelist

constants

Array ( [d] => Dragon [D] => Dragon [g] => Griffin [G] => Griffin [c] => Champion [C] => Champion [W] => Wizard [w] => Wizard [N] => ACMKnight [n] => ACMKnight [p] => Black_Pawn [P] => White_Pawn [q] => Queen [Q] => Queen [r] => Rook [R] => Rook [b] => Bishop [B] => Bishop [k] => Apothecary_King [K] => Apothecary_King [j] => Black_Joker [J] => White_Joker [z] => Sangoma [Z] => Sangoma )