This preset now uses the new code for identifying check, checkmate, and stalemate. Let me know of any problems with it.

Syntax Error on line 639

The function 'sL' has not been defined. Its arguments are c2

Edit the Settings File for Berolina Chess

For the sake of debugging, here is the full GAME Code program that this error occurred in. The lines have been properly indented to help you spot scope errors.

   0 echo This preset now uses the new code for identifying check, checkmate, and stalemate. Let me know of any problems with it.
   1 setflag a1 a8 h1 h8 e1 e8
   2 set k e8
   3 set K e1
   4 set ep false
   5 include berolina
   6 sub postauto1
   7   if isupper old
   8     die You may not capture your own pieces.
   9   endif
  10   if not equal moved S
  11     set ep false
  12     if unequal space dest moved
  13       die You may not change the type of this piece.
  14     endif
  15   endif
  16   set legal false
  17   if match moved S K
  18     gosub moved origin dest
  19     if equal moved K
  20       set K dest
  21     endif
  22   elseif match moved Q R B N
  23     set legal fn moved origin dest
  24     if equal moved R
  25       unsetflag origin
  26     endif
  27   endif
  28   if not var legal
  29     die You may not move a moved from origin to dest
  30   endif
  31   if fn ATTACKEDBYB #K
  32     die You may not move into check.
  33   endif
  34 endsub
  35 sub postauto2
  36   if islower old
  37     die You may not capture your own pieces.
  38   endif
  39   if not equal moved s
  40     set ep false
  41     if unequal space dest moved
  42       die You may not change the type of this piece.
  43     endif
  44   endif
  45   set legal false
  46   if match moved s k
  47     gosub moved origin dest
  48     if equal moved k
  49       set k dest
  50     endif
  51   elseif match moved q r b n
  52     set legal fn toupper moved origin dest
  53     if equal moved r
  54       unsetflag origin
  55     endif
  56   endif
  57   if not var legal
  58     die You may not move a moved from origin to dest
  59   endif
  60   if fn ATTACKEDBYW #k
  61     die You may not move into check.
  62   endif
  63 endsub
  64 moveindex 0
  65 MOVE: P d2-f4
  66 postauto1
  67 moveindex 1
  68 MOVE: p a7-c5
  69 postauto2
  70 moveindex 2
  71 MOVE: P b2-a3
  72 postauto1
  73 moveindex 3
  74 MOVE: p e7-d6
  75 postauto2
  76 moveindex 4
  77 MOVE: B c1-b2
  78 postauto1
  79 moveindex 5
  80 MOVE: p b7-d5
  81 postauto2
  82 moveindex 6
  83 MOVE: P e2-g4
  84 postauto1
  85 moveindex 7
  86 MOVE: p d5-c4
  87 postauto2
  88 moveindex 8
  89 MOVE: P a2-b3
  90 postauto1
  91 moveindex 9
  92 MOVE: b c8-b7
  93 postauto2
  94 moveindex 10
  95 MOVE: N g1-f3
  96 postauto1
  97 moveindex 11
  98 MOVE: q d8-e7
  99 postauto2
 100 moveindex 12
 101 MOVE: Q d1-e2
 102 postauto1
 103 moveindex 13
 104 MOVE: p h7-g6
 105 postauto2
 106 moveindex 14
 107 MOVE: P g2-h3
 108 postauto1
 109 moveindex 15
 110 MOVE: p d7-b5
 111 postauto2
 112 moveindex 16
 113 MOVE: Q e2-e7
 114 postauto1
 115 moveindex 17
 116 MOVE: n g8-e7
 117 postauto2
 118 moveindex 18
 119 MOVE: R h1-g1
 120 postauto1
 121 moveindex 19
 122 MOVE: p g7-f6
 123 postauto2
 124 moveindex 20
 125 MOVE: P g4-f5
 126 postauto1
 127 moveindex 21
 128 MOVE: b f8-g7
 129 postauto2
 130 moveindex 22
 131 MOVE: N f3-h4
 132 postauto1
 133 moveindex 23
 134 MOVE: p g6-h5
 135 postauto2
 136 moveindex 24
 137 MOVE: R g1-g7
 138 postauto1
 139 moveindex 25
 140 MOVE: p h5-h4
 141 postauto2
 142 moveindex 26
 143 MOVE: P f5-f6
 144 postauto1
 145 moveindex 27
 146 MOVE: p f7-f6
 147 postauto2
 148 moveindex 28
 149 MOVE: B b2-f6
 150 postauto1
 151 moveindex 29
 152 MOVE: n e7-d5
 153 postauto2
 154 moveindex 30
 155 MOVE: B f6-h4
 156 postauto1
 157 moveindex 31
 158 MOVE: n d5-f4
 159 postauto2
 160 moveindex 32
 161 MOVE: R g7-e7
 162 postauto1
 163 moveindex 33
 164 MOVE: k e8-f8
 165 postauto2
 166 moveindex 34
 167 MOVE: R e7-c7
 168 postauto1
 169 moveindex 35
 170 MOVE: b b7-e4
 171 postauto2
 172 moveindex 36
 173 MOVE: B h4-e7
 174 postauto1
 175 moveindex 37
 176 MOVE: k f8-g8
 177 postauto2
 178 moveindex 38
 179 MOVE: B e7-d6
 180 postauto1
 181 moveindex 39
 182 MOVE: n b8-a6
 183 postauto2
 184 moveindex 40
 185 MOVE: R c7-e7
 186 postauto1
 187 moveindex 41
 188 MOVE: n f4-d3
 189 postauto2
 190 moveindex 42
 191 MOVE: B f1-d3
 192 postauto1
 193 moveindex 43
 194 MOVE: b e4-d3
 195 postauto2
 196 moveindex 44
 197 MOVE: K e1-d2
 198 postauto1
 199 moveindex 45
 200 MOVE: b d3-g6
 201 postauto2
 202 moveindex 46
 203 MOVE: B d6-e5
 204 postauto1
 205 moveindex 47
 206 MOVE: r h8-h6
 207 postauto2
 208 moveindex 48
 209 MOVE: R e7-g7
 210 postauto1
 211 moveindex 49
 212 MOVE: k g8-f8
 213 postauto2
 214 moveindex 50
 215 MOVE: R g7-b7
 216 postauto1
 217 moveindex 51
 218 MOVE: r a8-d8
 219 postauto2
 220 moveindex 52
 221 MOVE: K d2-c1
 222 postauto1
 223 moveindex 53
 224 MOVE: p c5-d4
 225 postauto2
 226 moveindex 54
 227 MOVE: B e5-g7
 228 postauto1
 229 moveindex 55
 230 MOVE: k f8-e8
 231 postauto2
 232 moveindex 56
 233 MOVE: B g7-h6
 234 postauto1
 235 moveindex 57
 236 MOVE: r d8-d6
 237 postauto2
 238 moveindex 58
 239 MOVE: B h6-f4
 240 postauto1
 241 moveindex 59
 242 MOVE: r d6-e6
 243 postauto2
 244 moveindex 60
 245 MOVE: R b7-b5
 246 postauto1
 247 moveindex 61
 248 MOVE: r e6-e4
 249 postauto2
 250 moveindex 62
 251 MOVE: R b5-e5
 252 postauto1
 253 moveindex 63
 254 MOVE: r e4-e5
 255 postauto2
 256 moveindex 64
 257 MOVE: B f4-e5
 258 postauto1
 259 moveindex 65
 260 MOVE: n a6-c5
 261 postauto2
 262 moveindex 66
 263 MOVE: B e5-d4
 264 postauto1
 265 moveindex 67
 266 MOVE: n c5-b3
 267 postauto2
 268 moveindex 68
 269 MOVE: K c1-b2
 270 postauto1
 271 moveindex 69
 272 MOVE: n b3-a1
 273 postauto2
 274 moveindex 70
 275 MOVE: K b2-a1
 276 postauto1
 277 moveindex 71
 278 MOVE: b g6-c2
 279 postauto2
 280 moveindex 72
 281 MOVE: N b1-c3
 282 postauto1
 283 moveindex 73
 284 MOVE: b c2-g6
 285 postauto2
 286 moveindex 74
 287 MOVE: K a1-b2
 288 postauto1
 289 moveindex 75
 290 MOVE: p c4-d3
 291 postauto2
 292 moveindex 76
 293 MOVE: P h2-f4
 294 postauto1
 295 moveindex 77
 296 MOVE: p d3-c2
 297 postauto2
 298 moveindex 78
 299 MOVE: P a3-b4
 300 postauto1
 301 set checks sub checks #k
 302 if var checks
 303   if sub checkmated #k #checks
 304     say Checkmate! White has won!
 305     won
 306   else
 307     say Check!
 308   endif
 309 elseif sub stalemated #k
 310   say Stalemate! The game is drawn.
 311   drawn
 312 endif
 313 end
 314 
 315 lib berolina
 316 include chess
 317 def SL array where #0 0 1 where #0 -1 1 where #0 1 1
 318 def sl array where #0 0 -1 where #0 -1 -1 where #0 1 -1
 319 def S checkaleap #0 #1 0 1
 320 def s checkaleap #0 #1 0 -1
 321 def WPAWN match S what #0 0 -1
 322 def BPAWN match s what #0 0 1
 323 sub S from to
 324   if != file #from file #to and not capture
 325     set legal checkaleap #from #to 1 1 or checkaleap #from #to -1 1
 326     if var legal
 327       set ep false
 328     else
 329       set legal checkatwostep #from #to 1 1 1 1 or checkatwostep #from #to -1 1 -1 1 and == rankname #from 2
 330       set ep #to
 331     endif
 332     set epc false
 333   elseif capture or #ep
 334     set legal checkaleap #from #to 0 1
 335     set epc false
 336     if not capture and var legal
 337       set legal == #ep where #to sign minus file #from file #to
 338       if var legal
 339         capture #ep
 340         set epc #ep
 341       endif
 342     endif
 343     set ep false
 344   endif
 345   if != space #to moved and onboard where #to 0 1
 346     die "You may not promote a Pawn that can still move forward."
 347   endif
 348   if not onboard where #to 0 1
 349     if == S space #to
 350       die "You must promote a Pawn when it can no longer move forward."
 351     elseif not match space #to var wprom
 352       set np space #to
 353       die "You may not promote your Pawn to a" #np
 354     endif
 355   endif
 356 endsub
 357 sub s from to
 358   if != file #from file #to and not capture
 359     set legal checkaleap #from #to 1 -1 or checkaleap #from #to -1 -1
 360     if var legal
 361       set ep false
 362     else
 363       set legal checkatwostep #from #to 1 -1 1 -1 or checkatwostep #from #to -1 -1 -1 -1 and == rankname #from 7
 364       set ep #to
 365     endif
 366     set epc false
 367   elseif capture or #ep
 368     set legal checkaleap #from #to 0 -1
 369     set epc false
 370     if not capture and var legal
 371       set legal == #ep where #to sign minus file #from file #to
 372       if var legal
 373         capture #ep
 374         set epc #ep
 375       endif
 376     endif
 377     set ep false
 378   endif
 379   if != space #to moved and onboard where #to 0 -1
 380     die "You may not promote a Pawn that can still move forward."
 381   endif
 382   if not onboard where #to 0 -1
 383     if == s space #to
 384       die "You must promote a Pawn when it can no longer move forward."
 385     elseif not match space #to var bprom
 386       set np space #to
 387       die "You may not promote your Pawn to a" #np
 388     endif
 389   endif
 390 endsub
 391 sub S1 from to
 392   if != file #from file #to
 393     return not capture
 394   elseif capture
 395     return true
 396   elseif == file #to file #ep and == rank #from rank #ep and #ep
 397     capture #ep
 398     return true
 399   endif
 400   return false
 401 endsub
 402 sub SS from to
 403   if checkatwostep #from #to 1 1 1 1 or checkaleap #from #to 1 1 or checkatwostep #from #to -1 1 -1 1 or checkaleap #from #to -1 1
 404     return not capture
 405   elseif not checkaleap #from #to 0 1
 406     return false
 407   elseif capture
 408     return true
 409   elseif == file #to file #ep and == rank #from rank #ep and #ep
 410     capture #ep
 411     return true
 412   endif
 413   return false
 414 endsub
 415 sub ss from to
 416   if checkatwostep #from #to 1 -1 1 -1 or checkaleap #from #to 1 -1 or checkatwostep #from #to -1 -1 -1 -1 or checkaleap #from #to -1 -1
 417     return not capture
 418   elseif not checkaleap #from #to 0 -1
 419     return false
 420   elseif capture
 421     return true
 422   elseif == file #to file #ep and == rank #from rank #ep and #ep
 423     capture #ep
 424     return true
 425   endif
 426   return false
 427 endsub
 428 alias p s P S
 429 endlib
 430 lib chess
 431 set wpr 2
 432 set bpr 7
 433 set fps 2
 434 set pzs 1
 435 set wcastle c1 g1
 436 set bcastle c8 g8
 437 do
 438   local x
 439   for x piecekeys
 440     if match #x P K p k
 441       continue
 442     elseif isupper #x
 443       push wprom #x
 444     elseif islower #x
 445       push bprom #x
 446     endif
 447   next
 448 loop never
 449 setsystem maxmove 2
 450 ban commands allmoves
 451 allow moves 1 captures 1 promotions 2
 452 def N checkleap #0 #1 1 2
 453 def B checkride #0 #1 1 1
 454 def R checkride #0 #1 1 0
 455 def Q fn B #0 #1 or fn R #0 #1
 456 def K checkleap #0 #1 1 1 or checkleap #0 #1 1 0
 457 def M fn N #0 #1 or fn R #0 #1
 458 def A fn N #0 #1 or fn B #0 #1
 459 def n checkleap #0 #1 1 2
 460 def b checkride #0 #1 1 1
 461 def r checkride #0 #1 1 0
 462 def q fn b #0 #1 or fn r #0 #1
 463 def k checkleap #0 #1 1 1 or checkleap #0 #1 1 0
 464 def m fn n #0 #1 or fn r #0 #1
 465 def a fn n #0 #1 or fn b #0 #1
 466 def P
remove var ep
and checkleap #0 #1 1 1
and == var ep join filename #1 rankname #0
or and checkride #0 #1 0 1 == rankname #0 var wpr
or checkleap #0 #1 0 1
and empty #1
or and islower space #1 checkleap #0 #1 1 1
and <= distance #0 #1 var fps
and > rank #1 rank #0
 467 def p
remove var ep
and checkleap #0 #1 1 1
and == var ep join filename #1 rankname #0
or and checkride #0 #1 0 1 == rankname #0 var bpr
or checkleap #0 #1 0 1
and empty #1
or and isupper space #1 checkleap #0 #1 1 1
and <= distance #0 #1 var fps
and < rank #1 rank #0
 468 sub capturep p
 469   empty #p
 470   return true
 471 endsub
 472 sub checks king
 473   if not dest
 474     return false
 475   endif
 476   my checks c
 477   set checks ()
 478   if fn space dest dest #king
 479     setelem checks dest space dest
 480   endif
 481   set c sub checkedthru #king origin
 482   if #c
 483     setelem checks #c space #c
 484   elseif #epc
 485     set c sub checkedthru #king #epc
 486     if #c
 487       setelem checks #c space #c
 488     endif
 489   endif
 490   return var checks
 491 endsub
 492 sub checkmated king checks
 493   local from piece to key legalmove piece nopawn
 494   store
 495   if isupper space #king
 496     def friends onlyupper
 497     def friend isupper #0
 498     set attacked ATTACKEDBYB
 499   else
 500     def friends onlylower
 501     def friend islower #0
 502     set attacked ATTACKEDBYW
 503   endif
 504   set kingmoves fn KL #king
 505   for to #kingmoves
 506     if not fn friend space #to and onboard #to
 507       move #king #to
 508       set incheck fn var attacked #to
 509       restore
 510       if not #incheck
 511         setlegal #king #to
 512       endif
 513     endif
 514   next
 515   if == count var checks 1
 516     for (key enemy) var checks
 517       set possible path #king #key
 518       push possible #key
 519       if == #key #ep
 520         push possible cond isupper space #ep where #ep 0 -1 where #ep 0 1
 521       endif
 522       for (from piece) fn friends
 523         if == #from #king
 524           continue
 525         endif
 526         for to #possible
 527           if fn #piece #from #to
 528             move #from #to
 529             set incheck fn var attacked #king
 530             if not #incheck
 531               setlegal #from #to
 532             endif
 533           endif
 534           restore
 535         next
 536       next
 537     next
 538   endif
 539   return cond count system legalmoves false true and checks
 540 endsub
 541 def PL array where #0 0 2 where #0 0 1 where #0 -1 1 where #0 1 1
 542 def pL array where #0 0 -2 where #0 0 -1 where #0 -1 -1 where #0 1 -1
 543 def NL leaps #0 1 2
 544 def BL rays #0 1 1
 545 def RL rays #0 1 0
 546 def VL rays #0 1 1
 547 def CL rays #0 1 0
 548 def QL merge rays #0 1 0 rays #0 1 1
 549 def KL merge leaps #0 1 0 leaps #0 1 1
 550 def AL merge leaps #0 1 2 rays #0 1 1
 551 def ML merge rays #0 1 0 leaps #0 1 2
 552 def nL leaps #0 1 2
 553 def bL rays #0 1 1
 554 def rL rays #0 1 0
 555 def vL rays #0 1 1
 556 def cL rays #0 1 0
 557 def qL merge rays #0 1 0 rays #0 1 1
 558 def kL merge leaps #0 1 0 leaps #0 1 1
 559 def aL merge leaps #0 1 2 rays #0 1 1
 560 def mL merge rays #0 1 0 leaps #0 1 2
 561 sub castlepos from to
 562   local c RPOS RDEST xdir safe
 563   verify flag #from
 564   verify empty #to
 565   if isupper space #king
 566     def friend isupper #0
 567     def friends onlyupper
 568     set attacked ATTACKEDBYB
 569   else
 570     def friend islower #0
 571     def friends onlylower
 572     set attacked ATTACKEDBYW
 573   endif
 574   set xdir sign minus file #to file #from
 575   verify checkaride #from #to #xdir 0
 576   verify not fn var attacked #from
 577   set c #to
 578   do
 579     set c where #c #xdir 0
 580     if flag #c
 581       break
 582     endif
 583     verify onboard #c
 584     verify empty #c
 585   loop
 586   verify flag #c
 587   set RPOS #c
 588   store
 589   for c path #from #to
 590     move #from #c
 591     set safe not fn var attacked #c
 592     restore
 593     verify #safe
 594   next
 595   move #from #to
 596   set RDEST where #to neg #xdir 0
 597   move #RPOS #RDEST
 598   return true
 599 endsub
 600 sub stalemated king
 601   local legalmove temp from piece to attacked ra
 602   if isupper space #king
 603     def friend isupper #0
 604     def friends onlyupper
 605     set attacked ATTACKEDBYB
 606     set cspaces var wcastle
 607   else
 608     def friend islower #0
 609     def friends onlylower
 610     set attacked ATTACKEDBYW
 611     set cspaces var bcastle
 612   endif
 613   store
 614   set kingmoves fn KL #king
 615   for to #kingmoves
 616     if not fn friend space #to and onboard #to
 617       move #king #to
 618       set incheck fn var attacked #to
 619       restore
 620       if not #incheck
 621         setlegal #king #to
 622       endif
 623     endif
 624   next
 625   for to var cspaces
 626     if sub castlepos #king #to
 627       set incheck fn var attacked #to
 628       restore
 629       if not #incheck
 630         setlegal #king #to
 631       endif
 632     endif
 633   next
 634   restore
 635   for (from piece) fn friends
 636     if == #from #king
 637       continue
 638     endif
 639     for to fn join #piece L #from
 640       if fn #piece #from #to and not fn friend space #to and onboard #to
 641         move #from #to
 642         set incheck fn var attacked #king
 643         if not #incheck
 644           setlegal #from #to
 645         endif
 646       endif
 647       restore
 648     next
 649   next
 650   return cond count system legalmoves false true
 651 endsub
 652 def WPAWN match P what #0 1 -1 what #0 -1 -1
 653 def BPAWN match p what #0 1 1 what #0 -1 1
 654 def KNIGHT check what #0 1 2 check what #0 -1 2 check what #0 1 -2 check what #0 -1 -2 check what #0 2 1 check what #0 -2 1 check what #0 2 -1 check what #0 -2 -1 target #1
 655 def WAZIR check what #0 0 -1 check what #0 -1 0 check what #0 0 1 check what #0 1 0 target #1
 656 def FERZ check what #0 -1 -1 check what #0 -1 1 check what #0 1 -1 check what #0 1 1 target #1
 657 def KING fn WAZIR #0 #1 or fn FERZ #0 #1
 658 def ROOK check insight #0 0 -1 check insight #0 -1 0 check insight #0 0 1 check insight #0 1 0 target #1
 659 def BISHOP check insight #0 -1 -1 check insight #0 -1 1 check insight #0 1 -1 check insight #0 1 1 target #1
 660 def ATTACKEDBYB fn KING #0 k or fn BPAWN #0 or fn KNIGHT #0 (n a m) or fn ROOK #0 (r q m) or fn BISHOP #0 (b q a)
 661 def ATTACKEDBYW fn KING #0 K or fn WPAWN #0 or fn KNIGHT #0 (N A M) or fn ROOK #0 (R Q M) or fn BISHOP #0 (B Q A)
 662 sub P from to
 663   local ydir
 664   if == file #from file #to and not capture
 665     set legal checkaleap #from #to 0 1
 666     if var legal
 667       set ep false
 668     else
 669       set legal checkaride #from #to 0 1 and <= distance #from #to #fps and or == rankname #from #wpr < #wpr 0
 670       set ep #to
 671     endif
 672     set epc false
 673   elseif capture or #ep
 674     set legal checkaleap #from #to -1 1 or checkaleap #from #to 1 1
 675     set epc false
 676     if not capture and var legal
 677       set legal > rank #to rank #ep and < rankname #to #bpr and == file #to file #ep
 678       if var legal
 679         capture #ep
 680         set epc #ep
 681       endif
 682     endif
 683     set ep false
 684   endif
 685   if != space #to moved and onboard where #to 0 #pzs
 686     die "You may not promote a Pawn until it reaches the promotion zone."
 687   endif
 688   if not onboard where #to 0 1
 689     if == P space #to
 690       askpromote #wprom
 691     elseif not match space #to var wprom
 692       set np space #to
 693       die "You may not promote your Pawn to a" #np
 694     endif
 695   endif
 696 endsub
 697 sub p from to
 698   if == file #from file #to and not capture
 699     set legal checkaleap #from #to 0 -1
 700     if var legal
 701       set ep false
 702     else
 703       set legal checkaride #from #to 0 -1 and <= distance #from #to #fps and or == rankname #from #bpr > #bpr lastrank
 704       set ep #to
 705     endif
 706     set epc false
 707   elseif capture or #ep
 708     set legal checkaleap #from #to -1 -1 or checkaleap #from #to 1 -1
 709     set epc false
 710     if not capture and var legal
 711       set legal < rank #to rank #ep and > rankname #to #wpr and == file #to file #ep
 712       if var legal
 713         capture #ep
 714         set epc #ep
 715       endif
 716     endif
 717     set ep false
 718   endif
 719   if != space #to moved and onboard where #to 0 neg #pzs
 720     die You may not promote a Pawn until it reaches the promotion zone.
 721   endif
 722   if not onboard where #to 0 -1
 723     if == p space #to
 724       askpromote #bprom
 725     elseif not match space #to var bprom
 726       set np space #to
 727       die You may not promote your Pawn to a #np
 728     endif
 729   endif
 730 endsub
 731 sub K from to
 732   if match #to var wcastle and flag #from
 733     set legal sub castle
 734   else
 735     set legal fn K #from #to
 736   endif
 737   set K #to
 738   unsetflag e1
 739 endsub
 740 sub k from to
 741   if match #to var bcastle and flag #from
 742     set legal sub castle
 743   else
 744     set legal fn k #from #to
 745   endif
 746   set k #to
 747   unsetflag e8
 748 endsub
 749 sub castle
 750   local ATTACKED c RPOS RDEST xdir
 751   if not flag #from
 752     die A King may not castle after it moves.
 753   endif
 754   if capture
 755     die A King may not castle to an occupied space.
 756   endif
 757   set xdir sign minus file #to file #from
 758   if not checkaride #from #to #xdir 0
 759     die A King may not castle across any occupied space.
 760   endif
 761   set c #to
 762   do
 763     set c where #c #xdir 0
 764     if flag #c
 765       break
 766     elseif not onboard #c
 767       die No piece was found to castle with.
 768     elseif not empty #c
 769       die The King cannot castle with the piece at #c
 770     endif
 771   loop
 772   set RPOS #c
 773   set ATTACKED ATTACKEDBYW unless isupper moved ATTACKEDBYB
 774   if fn var ATTACKED #from
 775     die A King may not castle out of check.
 776   endif
 777   for c path #from #to
 778     if fn var ATTACKED #c
 779       die A King may not castle through check.
 780     endif
 781   next
 782   if == count var subargs 0
 783     set RDEST where #to neg #xdir 0
 784   else
 785     set RDEST elem 0 subarg
 786   endif
 787   unsetflag #RPOS
 788   move #RPOS #RDEST
 789   return true
 790 endsub
 791 sub checkedthru king loc
 792   my dir c
 793   set c revealed #king #loc
 794   verify fn space #c #c #king and not samecase space #king space #c and onboard #c and #c
 795   return #c
 796 endsub
 797 def fn checkedfrom fn space #1 #0 and xor isupper space #0 isupper space #1 and not empty #1
 798 sub P1 from to
 799   if == file #from file #to
 800     return not capture
 801   elseif capture
 802     return true
 803   elseif == file #to file #ep and == rank #from rank #ep and #ep
 804     capture #ep
 805     return true
 806   endif
 807   return false
 808 endsub
 809 sub PP from to
 810   if checkatwostep #from #to 0 1 0 1 or checkaleap #from #to 0 1
 811     return empty #to
 812   elseif not checkaleap #from #to 1 1 and not checkaleap #from #to -1 1
 813     return false
 814   elseif not empty #to
 815     return true
 816   elseif == file #to file #ep and == rank #from rank #ep and #ep
 817     capture #ep
 818     return true
 819   endif
 820   return false
 821 endsub
 822 sub pp from to
 823   if checkatwostep #from #to 0 -1 0 -1 or checkaleap #from #to 0 -1
 824     return empty #to
 825   elseif not checkaleap #from #to 1 -1 and not checkaleap #from #to -1 -1
 826     return false
 827   elseif not empty #to
 828     return true
 829   elseif == file #to file #ep and == rank #from rank #ep and #ep
 830     capture #ep
 831     return true
 832   endif
 833   return false
 834 endsub
 835 endlib

functions

Array ( [N] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 2 ) [B] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 1 ) [R] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 0 ) [Q] => Array ( [0] => fn [1] => B [2] => #0 [3] => #1 [4] => or [5] => fn [6] => R [7] => #0 [8] => #1 ) [K] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 1 [10] => 0 ) [M] => Array ( [0] => fn [1] => N [2] => #0 [3] => #1 [4] => or [5] => fn [6] => R [7] => #0 [8] => #1 ) [A] => Array ( [0] => fn [1] => N [2] => #0 [3] => #1 [4] => or [5] => fn [6] => B [7] => #0 [8] => #1 ) [n] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 2 ) [b] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 1 ) [r] => Array ( [0] => checkride [1] => #0 [2] => #1 [3] => 1 [4] => 0 ) [q] => Array ( [0] => fn [1] => b [2] => #0 [3] => #1 [4] => or [5] => fn [6] => r [7] => #0 [8] => #1 ) [k] => Array ( [0] => checkleap [1] => #0 [2] => #1 [3] => 1 [4] => 1 [5] => or [6] => checkleap [7] => #0 [8] => #1 [9] => 1 [10] => 0 ) [m] => Array ( [0] => fn [1] => n [2] => #0 [3] => #1 [4] => or [5] => fn [6] => r [7] => #0 [8] => #1 ) [a] => Array ( [0] => fn [1] => n [2] => #0 [3] => #1 [4] => or [5] => fn [6] => b [7] => #0 [8] => #1 ) [P] => Array ( [0] => remove [1] => var [2] => ep [3] => and [4] => checkleap [5] => #0 [6] => #1 [7] => 1 [8] => 1 [9] => and [10] => == [11] => var [12] => ep [13] => join [14] => filename [15] => #1 [16] => rankname [17] => #0 [18] => or [19] => and [20] => checkride [21] => #0 [22] => #1 [23] => 0 [24] => 1 [25] => == [26] => rankname [27] => #0 [28] => var [29] => wpr [30] => or [31] => checkleap [32] => #0 [33] => #1 [34] => 0 [35] => 1 [36] => and [37] => empty [38] => #1 [39] => or [40] => and [41] => islower [42] => space [43] => #1 [44] => checkleap [45] => #0 [46] => #1 [47] => 1 [48] => 1 [49] => and [50] => <= [51] => distance [52] => #0 [53] => #1 [54] => var [55] => fps [56] => and [57] => > [58] => rank [59] => #1 [60] => rank [61] => #0 ) [p] => Array ( [0] => remove [1] => var [2] => ep [3] => and [4] => checkleap [5] => #0 [6] => #1 [7] => 1 [8] => 1 [9] => and [10] => == [11] => var [12] => ep [13] => join [14] => filename [15] => #1 [16] => rankname [17] => #0 [18] => or [19] => and [20] => checkride [21] => #0 [22] => #1 [23] => 0 [24] => 1 [25] => == [26] => rankname [27] => #0 [28] => var [29] => bpr [30] => or [31] => checkleap [32] => #0 [33] => #1 [34] => 0 [35] => 1 [36] => and [37] => empty [38] => #1 [39] => or [40] => and [41] => isupper [42] => space [43] => #1 [44] => checkleap [45] => #0 [46] => #1 [47] => 1 [48] => 1 [49] => and [50] => <= [51] => distance [52] => #0 [53] => #1 [54] => var [55] => fps [56] => and [57] => < [58] => rank [59] => #1 [60] => rank [61] => #0 ) [PL] => Array ( [0] => array [1] => where [2] => #0 [3] => 0 [4] => 2 [5] => where [6] => #0 [7] => 0 [8] => 1 [9] => where [10] => #0 [11] => -1 [12] => 1 [13] => where [14] => #0 [15] => 1 [16] => 1 ) [pL] => Array ( [0] => array [1] => where [2] => #0 [3] => 0 [4] => -2 [5] => where [6] => #0 [7] => 0 [8] => -1 [9] => where [10] => #0 [11] => -1 [12] => -1 [13] => where [14] => #0 [15] => 1 [16] => -1 ) [NL] => Array ( [0] => leaps [1] => #0 [2] => 1 [3] => 2 ) [BL] => Array ( [0] => rays [1] => #0 [2] => 1 [3] => 1 ) [RL] => Array ( [0] => rays [1] => #0 [2] => 1 [3] => 0 ) [VL] => Array ( [0] => rays [1] => #0 [2] => 1 [3] => 1 ) [CL] => Array ( [0] => rays [1] => #0 [2] => 1 [3] => 0 ) [QL] => Array ( [0] => merge [1] => rays [2] => #0 [3] => 1 [4] => 0 [5] => rays [6] => #0 [7] => 1 [8] => 1 ) [KL] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 1 [4] => 0 [5] => leaps [6] => #0 [7] => 1 [8] => 1 ) [AL] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 1 [4] => 2 [5] => rays [6] => #0 [7] => 1 [8] => 1 ) [ML] => Array ( [0] => merge [1] => rays [2] => #0 [3] => 1 [4] => 0 [5] => leaps [6] => #0 [7] => 1 [8] => 2 ) [nL] => Array ( [0] => leaps [1] => #0 [2] => 1 [3] => 2 ) [bL] => Array ( [0] => rays [1] => #0 [2] => 1 [3] => 1 ) [rL] => Array ( [0] => rays [1] => #0 [2] => 1 [3] => 0 ) [vL] => Array ( [0] => rays [1] => #0 [2] => 1 [3] => 1 ) [cL] => Array ( [0] => rays [1] => #0 [2] => 1 [3] => 0 ) [qL] => Array ( [0] => merge [1] => rays [2] => #0 [3] => 1 [4] => 0 [5] => rays [6] => #0 [7] => 1 [8] => 1 ) [kL] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 1 [4] => 0 [5] => leaps [6] => #0 [7] => 1 [8] => 1 ) [aL] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 1 [4] => 2 [5] => rays [6] => #0 [7] => 1 [8] => 1 ) [mL] => Array ( [0] => merge [1] => rays [2] => #0 [3] => 1 [4] => 0 [5] => leaps [6] => #0 [7] => 1 [8] => 2 ) [WPAWN] => Array ( [0] => match [1] => S [2] => what [3] => #0 [4] => 0 [5] => -1 ) [BPAWN] => Array ( [0] => match [1] => s [2] => what [3] => #0 [4] => 0 [5] => 1 ) [KNIGHT] => Array ( [0] => check [1] => what [2] => #0 [3] => 1 [4] => 2 [5] => check [6] => what [7] => #0 [8] => -1 [9] => 2 [10] => check [11] => what [12] => #0 [13] => 1 [14] => -2 [15] => check [16] => what [17] => #0 [18] => -1 [19] => -2 [20] => check [21] => what [22] => #0 [23] => 2 [24] => 1 [25] => check [26] => what [27] => #0 [28] => -2 [29] => 1 [30] => check [31] => what [32] => #0 [33] => 2 [34] => -1 [35] => check [36] => what [37] => #0 [38] => -2 [39] => -1 [40] => target [41] => #1 ) [WAZIR] => Array ( [0] => check [1] => what [2] => #0 [3] => 0 [4] => -1 [5] => check [6] => what [7] => #0 [8] => -1 [9] => 0 [10] => check [11] => what [12] => #0 [13] => 0 [14] => 1 [15] => check [16] => what [17] => #0 [18] => 1 [19] => 0 [20] => target [21] => #1 ) [FERZ] => Array ( [0] => check [1] => what [2] => #0 [3] => -1 [4] => -1 [5] => check [6] => what [7] => #0 [8] => -1 [9] => 1 [10] => check [11] => what [12] => #0 [13] => 1 [14] => -1 [15] => check [16] => what [17] => #0 [18] => 1 [19] => 1 [20] => target [21] => #1 ) [KING] => Array ( [0] => fn [1] => WAZIR [2] => #0 [3] => #1 [4] => or [5] => fn [6] => FERZ [7] => #0 [8] => #1 ) [ROOK] => Array ( [0] => check [1] => insight [2] => #0 [3] => 0 [4] => -1 [5] => check [6] => insight [7] => #0 [8] => -1 [9] => 0 [10] => check [11] => insight [12] => #0 [13] => 0 [14] => 1 [15] => check [16] => insight [17] => #0 [18] => 1 [19] => 0 [20] => target [21] => #1 ) [BISHOP] => Array ( [0] => check [1] => insight [2] => #0 [3] => -1 [4] => -1 [5] => check [6] => insight [7] => #0 [8] => -1 [9] => 1 [10] => check [11] => insight [12] => #0 [13] => 1 [14] => -1 [15] => check [16] => insight [17] => #0 [18] => 1 [19] => 1 [20] => target [21] => #1 ) [ATTACKEDBYB] => Array ( [0] => fn [1] => KING [2] => #0 [3] => k [4] => or [5] => fn [6] => BPAWN [7] => #0 [8] => or [9] => fn [10] => KNIGHT [11] => #0 [12] => Array ( [0] => n [1] => a [2] => m ) [13] => or [14] => fn [15] => ROOK [16] => #0 [17] => Array ( [0] => r [1] => q [2] => m ) [18] => or [19] => fn [20] => BISHOP [21] => #0 [22] => Array ( [0] => b [1] => q [2] => a ) ) [ATTACKEDBYW] => Array ( [0] => fn [1] => KING [2] => #0 [3] => K [4] => or [5] => fn [6] => WPAWN [7] => #0 [8] => or [9] => fn [10] => KNIGHT [11] => #0 [12] => Array ( [0] => N [1] => A [2] => M ) [13] => or [14] => fn [15] => ROOK [16] => #0 [17] => Array ( [0] => R [1] => Q [2] => M ) [18] => or [19] => fn [20] => BISHOP [21] => #0 [22] => Array ( [0] => B [1] => Q [2] => A ) ) [fn] => Array ( [0] => checkedfrom [1] => fn [2] => space [3] => #1 [4] => #0 [5] => and [6] => xor [7] => isupper [8] => space [9] => #0 [10] => isupper [11] => space [12] => #1 [13] => and [14] => not [15] => empty [16] => #1 ) [SL] => Array ( [0] => array [1] => where [2] => #0 [3] => 0 [4] => 1 [5] => where [6] => #0 [7] => -1 [8] => 1 [9] => where [10] => #0 [11] => 1 [12] => 1 ) [sl] => Array ( [0] => array [1] => where [2] => #0 [3] => 0 [4] => -1 [5] => where [6] => #0 [7] => -1 [8] => -1 [9] => where [10] => #0 [11] => 1 [12] => -1 ) [S] => Array ( [0] => checkaleap [1] => #0 [2] => #1 [3] => 0 [4] => 1 ) [s] => Array ( [0] => checkaleap [1] => #0 [2] => #1 [3] => 0 [4] => -1 ) [friend] => Array ( [0] => islower [1] => #0 ) [friends] => Array ( [0] => onlylower ) )

uservar

Array ( [0] => Array ( [main] => Array ( [k] => e8 [K] => b2 [ep] => [wpr] => 2 [bpr] => 7 [fps] => 2 [pzs] => 1 [wcastle] => Array ( [0] => g1 [1] => c1 ) [bcastle] => Array ( [0] => g8 [1] => c8 ) [bprom] => Array ( [0] => r [1] => n [2] => b [3] => q [4] => s ) [wprom] => Array ( [0] => S [1] => R [2] => N [3] => B [4] => Q ) [legal] => 1 [epc] => [RESULT] => [checks] => Array ( ) [cspaces] => Array ( [0] => g8 [1] => c8 ) [kingmoves] => Array ( [0] => f8 [1] => d8 [2] => e7 [3] => f7 [4] => d7 ) [incheck] => ) ) [2] => Array ( [stalemated] => Array ( [subargs] => Array ( [0] => e8 ) ) [main] => Array ( [king] => e8 [legalmove] => 0 [temp] => 0 [from] => c2 [piece] => s [to] => b1 [attacked] => ATTACKEDBYW [ra] => 0 ) ) )

mline

Array ( [0] => MoveLine Object ( [movenum] => 1 [move] => P d2-f4 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 1 ) [1] => MoveLine Object ( [movenum] => 2 [move] => p a7-c5 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 1 ) [2] => MoveLine Object ( [movenum] => 3 [move] => P b2-a3 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 2 ) [3] => MoveLine Object ( [movenum] => 4 [move] => p e7-d6 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 2 ) [4] => MoveLine Object ( [movenum] => 5 [move] => B c1-b2 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 3 ) [5] => MoveLine Object ( [movenum] => 6 [move] => p b7-d5 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 3 ) [6] => MoveLine Object ( [movenum] => 7 [move] => P e2-g4 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 4 ) [7] => MoveLine Object ( [movenum] => 8 [move] => p d5-c4 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 4 ) [8] => MoveLine Object ( [movenum] => 9 [move] => P a2-b3 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 5 ) [9] => MoveLine Object ( [movenum] => 10 [move] => b c8-b7 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 5 ) [10] => MoveLine Object ( [movenum] => 11 [move] => N g1-f3 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 6 ) [11] => MoveLine Object ( [movenum] => 12 [move] => q d8-e7 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 6 ) [12] => MoveLine Object ( [movenum] => 13 [move] => Q d1-e2 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 7 ) [13] => MoveLine Object ( [movenum] => 14 [move] => p h7-g6 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 7 ) [14] => MoveLine Object ( [movenum] => 15 [move] => P g2-h3 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 8 ) [15] => MoveLine Object ( [movenum] => 16 [move] => p d7-b5 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 8 ) [16] => MoveLine Object ( [movenum] => 17 [move] => Q e2-e7 [level] => 0 [comment] => [length] => 10 [newturn] => 1 [turn] => 9 ) [17] => MoveLine Object ( [movenum] => 18 [move] => n g8-e7 [level] => 0 [comment] => [length] => 12 [newturn] => [turn] => 9 ) [18] => MoveLine Object ( [movenum] => 19 [move] => R h1-g1 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 10 ) [19] => MoveLine Object ( [movenum] => 20 [move] => p g7-f6 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 10 ) [20] => MoveLine Object ( [movenum] => 21 [move] => P g4-f5 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 11 ) [21] => MoveLine Object ( [movenum] => 22 [move] => b f8-g7 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 11 ) [22] => MoveLine Object ( [movenum] => 23 [move] => N f3-h4 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 12 ) [23] => MoveLine Object ( [movenum] => 24 [move] => p g6-h5 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 12 ) [24] => MoveLine Object ( [movenum] => 25 [move] => R g1-g7 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 13 ) [25] => MoveLine Object ( [movenum] => 26 [move] => p h5-h4 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 13 ) [26] => MoveLine Object ( [movenum] => 27 [move] => P f5-f6 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 14 ) [27] => MoveLine Object ( [movenum] => 28 [move] => p f7-f6 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 14 ) [28] => MoveLine Object ( [movenum] => 29 [move] => B b2-f6 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 15 ) [29] => MoveLine Object ( [movenum] => 30 [move] => n e7-d5 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 15 ) [30] => MoveLine Object ( [movenum] => 31 [move] => B f6-h4 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 16 ) [31] => MoveLine Object ( [movenum] => 32 [move] => n d5-f4 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 16 ) [32] => MoveLine Object ( [movenum] => 33 [move] => R g7-e7 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 17 ) [33] => MoveLine Object ( [movenum] => 34 [move] => k e8-f8 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 17 ) [34] => MoveLine Object ( [movenum] => 35 [move] => R e7-c7 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 18 ) [35] => MoveLine Object ( [movenum] => 36 [move] => b b7-e4 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 18 ) [36] => MoveLine Object ( [movenum] => 37 [move] => B h4-e7 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 19 ) [37] => MoveLine Object ( [movenum] => 38 [move] => k f8-g8 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 19 ) [38] => MoveLine Object ( [movenum] => 39 [move] => B e7-d6 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 20 ) [39] => MoveLine Object ( [movenum] => 40 [move] => n b8-a6 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 20 ) [40] => MoveLine Object ( [movenum] => 41 [move] => R c7-e7 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 21 ) [41] => MoveLine Object ( [movenum] => 42 [move] => n f4-d3 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 21 ) [42] => MoveLine Object ( [movenum] => 43 [move] => B f1-d3 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 22 ) [43] => MoveLine Object ( [movenum] => 44 [move] => b e4-d3 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 22 ) [44] => MoveLine Object ( [movenum] => 45 [move] => K e1-d2 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 23 ) [45] => MoveLine Object ( [movenum] => 46 [move] => b d3-g6 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 23 ) [46] => MoveLine Object ( [movenum] => 47 [move] => B d6-e5 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 24 ) [47] => MoveLine Object ( [movenum] => 48 [move] => r h8-h6 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 24 ) [48] => MoveLine Object ( [movenum] => 49 [move] => R e7-g7 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 25 ) [49] => MoveLine Object ( [movenum] => 50 [move] => k g8-f8 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 25 ) [50] => MoveLine Object ( [movenum] => 51 [move] => R g7-b7 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 26 ) [51] => MoveLine Object ( [movenum] => 52 [move] => r a8-d8 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 26 ) [52] => MoveLine Object ( [movenum] => 53 [move] => K d2-c1 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 27 ) [53] => MoveLine Object ( [movenum] => 54 [move] => p c5-d4 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 27 ) [54] => MoveLine Object ( [movenum] => 55 [move] => B e5-g7 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 28 ) [55] => MoveLine Object ( [movenum] => 56 [move] => k f8-e8 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 28 ) [56] => MoveLine Object ( [movenum] => 57 [move] => B g7-h6 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 29 ) [57] => MoveLine Object ( [movenum] => 58 [move] => r d8-d6 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 29 ) [58] => MoveLine Object ( [movenum] => 59 [move] => B h6-f4 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 30 ) [59] => MoveLine Object ( [movenum] => 60 [move] => r d6-e6 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 30 ) [60] => MoveLine Object ( [movenum] => 61 [move] => R b7-b5 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 31 ) [61] => MoveLine Object ( [movenum] => 62 [move] => r e6-e4 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 31 ) [62] => MoveLine Object ( [movenum] => 63 [move] => R b5-e5 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 32 ) [63] => MoveLine Object ( [movenum] => 64 [move] => r e4-e5 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 32 ) [64] => MoveLine Object ( [movenum] => 65 [move] => B f4-e5 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 33 ) [65] => MoveLine Object ( [movenum] => 66 [move] => n a6-c5 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 33 ) [66] => MoveLine Object ( [movenum] => 67 [move] => B e5-d4 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 34 ) [67] => MoveLine Object ( [movenum] => 68 [move] => n c5-b3 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 34 ) [68] => MoveLine Object ( [movenum] => 69 [move] => K c1-b2 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 35 ) [69] => MoveLine Object ( [movenum] => 70 [move] => n b3-a1 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 35 ) [70] => MoveLine Object ( [movenum] => 71 [move] => K b2-a1 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 36 ) [71] => MoveLine Object ( [movenum] => 72 [move] => b g6-c2 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 36 ) [72] => MoveLine Object ( [movenum] => 73 [move] => N b1-c3 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 37 ) [73] => MoveLine Object ( [movenum] => 74 [move] => b c2-g6 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 37 ) [74] => MoveLine Object ( [movenum] => 75 [move] => K a1-b2 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 38 ) [75] => MoveLine Object ( [movenum] => 76 [move] => p c4-d3 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 38 ) [76] => MoveLine Object ( [movenum] => 77 [move] => P h2-f4 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 39 ) [77] => MoveLine Object ( [movenum] => 78 [move] => p d3-c2 [level] => 0 [comment] => [length] => 13 [newturn] => [turn] => 39 ) [78] => MoveLine Object ( [movenum] => 79 [move] => P a3-b4 [level] => 0 [comment] => [length] => 11 [newturn] => 1 [turn] => 40 ) )

allmoves

Array ( [0] => moveindex 78;MOVE: P a3-b4;postauto1 [1] => moveindex 77;MOVE: p d3-c2;postauto2 [2] => moveindex 76;MOVE: P h2-f4;postauto1 [3] => moveindex 75;MOVE: p c4-d3;postauto2 [4] => moveindex 74;MOVE: K a1-b2;postauto1 [5] => moveindex 73;MOVE: b c2-g6;postauto2 [6] => moveindex 72;MOVE: N b1-c3;postauto1 [7] => moveindex 71;MOVE: b g6-c2;postauto2 [8] => moveindex 70;MOVE: K b2-a1;postauto1 [9] => moveindex 69;MOVE: n b3-a1;postauto2 [10] => moveindex 68;MOVE: K c1-b2;postauto1 [11] => moveindex 67;MOVE: n c5-b3;postauto2 [12] => moveindex 66;MOVE: B e5-d4;postauto1 [13] => moveindex 65;MOVE: n a6-c5;postauto2 [14] => moveindex 64;MOVE: B f4-e5;postauto1 [15] => moveindex 63;MOVE: r e4-e5;postauto2 [16] => moveindex 62;MOVE: R b5-e5;postauto1 [17] => moveindex 61;MOVE: r e6-e4;postauto2 [18] => moveindex 60;MOVE: R b7-b5;postauto1 [19] => moveindex 59;MOVE: r d6-e6;postauto2 [20] => moveindex 58;MOVE: B h6-f4;postauto1 [21] => moveindex 57;MOVE: r d8-d6;postauto2 [22] => moveindex 56;MOVE: B g7-h6;postauto1 [23] => moveindex 55;MOVE: k f8-e8;postauto2 [24] => moveindex 54;MOVE: B e5-g7;postauto1 [25] => moveindex 53;MOVE: p c5-d4;postauto2 [26] => moveindex 52;MOVE: K d2-c1;postauto1 [27] => moveindex 51;MOVE: r a8-d8;postauto2 [28] => moveindex 50;MOVE: R g7-b7;postauto1 [29] => moveindex 49;MOVE: k g8-f8;postauto2 [30] => moveindex 48;MOVE: R e7-g7;postauto1 [31] => moveindex 47;MOVE: r h8-h6;postauto2 [32] => moveindex 46;MOVE: B d6-e5;postauto1 [33] => moveindex 45;MOVE: b d3-g6;postauto2 [34] => moveindex 44;MOVE: K e1-d2;postauto1 [35] => moveindex 43;MOVE: b e4-d3;postauto2 [36] => moveindex 42;MOVE: B f1-d3;postauto1 [37] => moveindex 41;MOVE: n f4-d3;postauto2 [38] => moveindex 40;MOVE: R c7-e7;postauto1 [39] => moveindex 39;MOVE: n b8-a6;postauto2 [40] => moveindex 38;MOVE: B e7-d6;postauto1 [41] => moveindex 37;MOVE: k f8-g8;postauto2 [42] => moveindex 36;MOVE: B h4-e7;postauto1 [43] => moveindex 35;MOVE: b b7-e4;postauto2 [44] => moveindex 34;MOVE: R e7-c7;postauto1 [45] => moveindex 33;MOVE: k e8-f8;postauto2 [46] => moveindex 32;MOVE: R g7-e7;postauto1 [47] => moveindex 31;MOVE: n d5-f4;postauto2 [48] => moveindex 30;MOVE: B f6-h4;postauto1 [49] => moveindex 29;MOVE: n e7-d5;postauto2 [50] => moveindex 28;MOVE: B b2-f6;postauto1 [51] => moveindex 27;MOVE: p f7-f6;postauto2 [52] => moveindex 26;MOVE: P f5-f6;postauto1 [53] => moveindex 25;MOVE: p h5-h4;postauto2 [54] => moveindex 24;MOVE: R g1-g7;postauto1 [55] => moveindex 23;MOVE: p g6-h5;postauto2 [56] => moveindex 22;MOVE: N f3-h4;postauto1 [57] => moveindex 21;MOVE: b f8-g7;postauto2 [58] => moveindex 20;MOVE: P g4-f5;postauto1 [59] => moveindex 19;MOVE: p g7-f6;postauto2 [60] => moveindex 18;MOVE: R h1-g1;postauto1 [61] => moveindex 17;MOVE: n g8-e7;postauto2 [62] => moveindex 16;MOVE: Q e2-e7;postauto1 [63] => moveindex 15;MOVE: p d7-b5;postauto2 [64] => moveindex 14;MOVE: P g2-h3;postauto1 [65] => moveindex 13;MOVE: p h7-g6;postauto2 [66] => moveindex 12;MOVE: Q d1-e2;postauto1 [67] => moveindex 11;MOVE: q d8-e7;postauto2 [68] => moveindex 10;MOVE: N g1-f3;postauto1 [69] => moveindex 9;MOVE: b c8-b7;postauto2 [70] => moveindex 8;MOVE: P a2-b3;postauto1 [71] => moveindex 7;MOVE: p d5-c4;postauto2 [72] => moveindex 6;MOVE: P e2-g4;postauto1 [73] => moveindex 5;MOVE: p b7-d5;postauto2 [74] => moveindex 4;MOVE: B c1-b2;postauto1 [75] => moveindex 3;MOVE: p e7-d6;postauto2 [76] => moveindex 2;MOVE: P b2-a3;postauto1 [77] => moveindex 1;MOVE: p a7-c5;postauto2 [78] => moveindex 0;MOVE: P d2-f4;postauto1 )

movelist

1. P d2-f4 1... p a7-c5 2. P b2-a3 2... p e7-d6 3. B c1-b2 3... p b7-d5 4. P e2-g4 4... p d5-c4 5. P a2-b3 5... b c8-b7 6. N g1-f3 6... q d8-e7 7. Q d1-e2 7... p h7-g6 8. P g2-h3 8... p d7-b5 9. Q e2-e7 9... n g8-e7 10. R h1-g1 10... p g7-f6 11. P g4-f5 11... b f8-g7 12. N f3-h4 12... p g6-h5 13. R g1-g7 13... p h5-h4 14. P f5-f6 14... p f7-f6 15. B b2-f6 15... n e7-d5 16. B f6-h4 16... n d5-f4 17. R g7-e7 17... k e8-f8 18. R e7-c7 18... b b7-e4 19. B h4-e7 19... k f8-g8 20. B e7-d6 20... n b8-a6 21. R c7-e7 21... n f4-d3 22. B f1-d3 22... b e4-d3 23. K e1-d2 23... b d3-g6 24. B d6-e5 24... r h8-h6 25. R e7-g7 25... k g8-f8 26. R g7-b7 26... r a8-d8 27. K d2-c1 27... p c5-d4 28. B e5-g7 28... k f8-e8 29. B g7-h6 29... r d8-d6 30. B h6-f4 30... r d6-e6 31. R b7-b5 31... r e6-e4 32. R b5-e5 32... r e4-e5 33. B f4-e5 33... n a6-c5 34. B e5-d4 34... n c5-b3 35. K c1-b2 35... n b3-a1 36. K b2-a1 36... b g6-c2 37. N b1-c3 37... b c2-g6 38. K a1-b2 38... p c4-d3 39. P h2-f4 39... p d3-c2 40. P a3-b4

constants

Array ( )