You may not move a White King from f0 to d0

Use your browser's BACK button to go back to the previous page, then reload if necessary.

For general reference, here is the complete list of moves:

1. P f1-f3 
1... p f8-f5 
2. P e1-e3 
2... p e8-e5 
3. N h0-g2 
3... w w3-j7 
4. N c0-d2 
4... n h9-g7 
5. C a0-c2 
5... c a9-c7 
6. C j0-h2 
6... c j9-h7 
7. B d0-h4 
7... b g9-e7 
8. Q e0-e1 
8... b e7-d6 
9. K f0-d0 
9... k f9-h9 
10. P i1-i3 
10... w w4-a7 
11. K d0-c0 
11... n g7-i6 
12. P j1-j3 
12... w j7-g6 
13. B h4-f2 
13... n i6-g5 
14. P f3-f4 
14... p e5-f4 
15. C h2-f4 
15... n c9-d7 
16. B f2-h4 
16... b d6-e7 
17. Q e1-g3 
17... c h7-h6 
18. C f4-h6 
18... w g6-d5 
19. B h4-g5 
19... b e7-g5 
20. Q g3-g5 
20... c c7-e7 
21. Q g5-h4 
21... w a7-d6 
22. Q h4-j6 
22... p i8-i7 
23. Q j6-j8 
23... p g8-g7 
24. C h6-h7 
24... k h9-g8 
25. C h7-i7 
25... r g9-h9 
26. P e3-e4 
26... k g8-f7 
27. C i7-h7 
27... k f7-e8 
28. P e4-d5 
28... resign

If this is your settings file, you may edit it at https://www.chessvariants.com/play/pbm/play.php?game=Omega+Chess&settings=Alfaerie&submit=Edit

Here is a code listing:

   0 include chess
   1 set wcastle c0 h0
   2 set bcastle c9 h9
   3 set K findpiece K spaces
   4 set k findpiece k spaces
   5 set ep false
   6 setflag b0 f0 i0 b9 f9 i9
   7 set names assoc p "Black Pawn" P "White Pawn" n "Black Knight" N "White Knight" b "Black Bishop" B "White Bishop" w "Black Wizard" W "White Wizard" s "Black Champion" S "White Champion" r "Black Rook" R "White Rook" q "Black Queen" Q "White Queen" k "Black King" K "White King"
   8 set fps 3
   9 set wpr 1
  10 set bpr 8
  11 alias c s C S w1 !x!1 w2 !y!1 w3 !y!2 w4 !x!2
  12 def s checkleap #0 #1 0 1 or checkleap #0 #1 0 2 or checkleap #0 #1 2 2
  13 def S checkleap #0 #1 0 1 or checkleap #0 #1 0 2 or checkleap #0 #1 2 2
  14 def w checkleap #0 #1 1 1 or checkleap #0 #1 1 3
  15 def W checkleap #0 #1 1 1 or checkleap #0 #1 1 3
  16 def CAMEL check what #0 1 3 check what #0 -1 3 check what #0 1 -3 check what #0 -1 -3 check what #0 3 1 check what #0 -3 1 check what #0 3 -1 check what #0 -3 -1 target #1
  17 def DABBABAH check what #0 0 -2 check what #0 -2 0 check what #0 0 2 check what #0 2 0 target #1
  18 def ALFIL check what #0 -2 -2 check what #0 -2 2 check what #0 2 -2 check what #0 2 2 target #1
  19 def ATTACKEDBYB fn CAMEL #0 w or fn ALFIL #0 s or fn DABBABAH #0 s or fn WAZIR #0 (k s) or fn FERZ #0 (k w) or fn BPAWN #0 or fn KNIGHT #0 n or fn ROOK #0 (r q) or fn BISHOP #0 (b q)
  20 def ATTACKEDBYW fn CAMEL #0 W or fn ALFIL #0 S or fn DABBABAH #0 S or fn WAZIR #0 (K S) or fn FERZ #0 (K W) or fn WPAWN #0 or fn KNIGHT #0 N or fn ROOK #0 (R Q) or fn BISHOP #0 (B Q)
  21 def PL array where #0 0 3 where #0 0 2 where #0 0 1 where #0 -1 1 where #0 1 1
  22 def pL array where #0 0 -3 where #0 0 -2 where #0 0 -1 where #0 -1 -1 where #0 1 -1
  23 def SL merge merge leaps #0 0 1 leaps #0 0 2 leaps #0 2 2
  24 def WL merge leaps #0 1 1 leaps #0 1 3
  25 def sL merge merge leaps #0 0 1 leaps #0 0 2 leaps #0 2 2
  26 def wL merge leaps #0 1 1 leaps #0 1 3
  27 sub postauto1
  28   if isupper old
  29     die You may not capture your own pieces.
  30   endif
  31   if == moved P
  32     set nopvc 0
  33   else
  34     set ep false
  35     if capture
  36       set nopvc 0
  37     else
  38       inc nopvc
  39     endif
  40     if unequal space dest moved
  41       die You may not change the type of this piece.
  42     endif
  43   endif
  44   set legal false
  45   if match moved P K
  46     gosub moved origin dest
  47     if equal moved K
  48       set K dest
  49     endif
  50   elseif match moved Q R B N S W
  51     set legal fn moved origin dest
  52     if == moved R
  53       unsetflag origin
  54     else
  55       unsetflag dest
  56     endif
  57   endif
  58   if not var legal
  59     set ori alias origin
  60     set dst alias dest
  61     set name elem moved names
  62     die You may not move a #name from #ori to #dst
  63   endif
  64   if fn ATTACKEDBYB #K
  65     die You may not move into check.
  66   endif
  67   set posvar join "w" join fencode boardflags
  68   inc #posvar
  69 endsub
  70 sub postauto2
  71   if islower old
  72     die You may not capture your own pieces.
  73   endif
  74   if == moved p
  75     set nopvc 0
  76   else
  77     set ep false
  78     if capture
  79       set nopvc 0
  80     else
  81       inc nopvc
  82     endif
  83     if unequal space dest moved
  84       die You may not change the type of this piece.
  85     endif
  86   endif
  87   set legal false
  88   if match moved p k
  89     gosub moved origin dest
  90     if equal moved k
  91       set k dest
  92     endif
  93   elseif match moved q r b n s w
  94     set legal fn toupper moved origin dest
  95     if == moved r
  96       unsetflag origin
  97     else
  98       unsetflag dest
  99     endif
 100   endif
 101   if not var legal
 102     set ori alias origin
 103     set dst alias dest
 104     set name elem moved names
 105     die You may not move a #name from #ori to #dst
 106   endif
 107   if fn ATTACKEDBYW #k
 108     die You may not move into check.
 109   endif
 110   set posvar join "b" join fencode boardflags
 111   inc #posvar
 112 endsub
 113 moveindex 0
 114 MOVE: P f1-f3
 115 postauto1
 116 moveindex 1
 117 MOVE: p f8-f5
 118 postauto2
 119 moveindex 2
 120 MOVE: P e1-e3
 121 postauto1
 122 moveindex 3
 123 MOVE: p e8-e5
 124 postauto2
 125 moveindex 4
 126 MOVE: N h0-g2
 127 postauto1
 128 moveindex 5
 129 MOVE: w w3-j7
 130 postauto2
 131 moveindex 6
 132 MOVE: N c0-d2
 133 postauto1
 134 moveindex 7
 135 MOVE: n h9-g7
 136 postauto2
 137 moveindex 8
 138 MOVE: C a0-c2
 139 postauto1
 140 moveindex 9
 141 MOVE: c a9-c7
 142 postauto2
 143 moveindex 10
 144 MOVE: C j0-h2
 145 postauto1
 146 moveindex 11
 147 MOVE: c j9-h7
 148 postauto2
 149 moveindex 12
 150 MOVE: B d0-h4
 151 postauto1
 152 moveindex 13
 153 MOVE: b g9-e7
 154 postauto2
 155 moveindex 14
 156 MOVE: Q e0-e1
 157 postauto1
 158 moveindex 15
 159 MOVE: b e7-d6
 160 postauto2
 161 moveindex 16
 162 MOVE: K f0-d0
 163 postauto1
 164 moveindex 17
 165 MOVE: k f9-h9
 166 postauto2
 167 moveindex 18
 168 MOVE: P i1-i3
 169 postauto1
 170 moveindex 19
 171 MOVE: w w4-a7
 172 postauto2
 173 moveindex 20
 174 MOVE: K d0-c0
 175 postauto1
 176 moveindex 21
 177 MOVE: n g7-i6
 178 postauto2
 179 moveindex 22
 180 MOVE: P j1-j3
 181 postauto1
 182 moveindex 23
 183 MOVE: w j7-g6
 184 postauto2
 185 moveindex 24
 186 MOVE: B h4-f2
 187 postauto1
 188 moveindex 25
 189 MOVE: n i6-g5
 190 postauto2
 191 moveindex 26
 192 MOVE: P f3-f4
 193 postauto1
 194 moveindex 27
 195 MOVE: p e5-f4
 196 postauto2
 197 moveindex 28
 198 MOVE: C h2-f4
 199 postauto1
 200 moveindex 29
 201 MOVE: n c9-d7
 202 postauto2
 203 moveindex 30
 204 MOVE: B f2-h4
 205 postauto1
 206 moveindex 31
 207 MOVE: b d6-e7
 208 postauto2
 209 moveindex 32
 210 MOVE: Q e1-g3
 211 postauto1
 212 moveindex 33
 213 MOVE: c h7-h6
 214 postauto2
 215 moveindex 34
 216 MOVE: C f4-h6
 217 postauto1
 218 moveindex 35
 219 MOVE: w g6-d5
 220 postauto2
 221 moveindex 36
 222 MOVE: B h4-g5
 223 postauto1
 224 moveindex 37
 225 MOVE: b e7-g5
 226 postauto2
 227 moveindex 38
 228 MOVE: Q g3-g5
 229 postauto1
 230 moveindex 39
 231 MOVE: c c7-e7
 232 postauto2
 233 moveindex 40
 234 MOVE: Q g5-h4
 235 postauto1
 236 moveindex 41
 237 MOVE: w a7-d6
 238 postauto2
 239 moveindex 42
 240 MOVE: Q h4-j6
 241 postauto1
 242 moveindex 43
 243 MOVE: p i8-i7
 244 postauto2
 245 moveindex 44
 246 MOVE: Q j6-j8
 247 postauto1
 248 moveindex 45
 249 MOVE: p g8-g7
 250 postauto2
 251 moveindex 46
 252 MOVE: C h6-h7
 253 postauto1
 254 moveindex 47
 255 MOVE: k h9-g8
 256 postauto2
 257 moveindex 48
 258 MOVE: C h7-i7
 259 postauto1
 260 moveindex 49
 261 MOVE: r g9-h9
 262 postauto2
 263 moveindex 50
 264 MOVE: P e3-e4
 265 postauto1
 266 moveindex 51
 267 MOVE: k g8-f7
 268 postauto2
 269 moveindex 52
 270 MOVE: C i7-h7
 271 postauto1
 272 moveindex 53
 273 MOVE: k f7-e8
 274 postauto2
 275 moveindex 54
 276 MOVE: P e4-d5
 277 postauto1
 278 moveindex 55
 279 MOVE: resign
 280 postauto2
 281 set posvar join "b" join fencode boardflags
 282 if >= var #posvar 3
 283   say Three Times Repetition! Drawn Game!
 284   drawn
 285 endif
 286 set checks sub checks #K
 287 if var checks
 288   if sub checkmated #K #checks
 289     say Checkmate! Black has won!
 290     won
 291   else
 292     say Check!
 293   endif
 294 elseif sub stalemated #K
 295   say Stalemate! The game is drawn.
 296   drawn
 297 endif
 298 if >= #nopvc 100
 299   say Fifty Moves Without Moving a Pawn or Capturing! Game Drawn!
 300   drawn
 301 endif
 302 end
 303 
 304 lib chess
 305 set wpr 2
 306 set bpr 7
 307 set fps 2
 308 set pzs 1
 309 set wcastle c1 g1
 310 set bcastle c8 g8
 311 do
 312   local x
 313   for x piecekeys
 314     if match #x P K p k
 315       continue
 316     elseif isupper #x
 317       push wprom #x
 318     elseif islower #x
 319       push bprom #x
 320     endif
 321   next
 322 loop never
 323 setsystem maxmove 2
 324 ban commands allmoves
 325 allow moves 1 captures 1 promotions 2
 326 def N checkleap #0 #1 1 2
 327 def B checkride #0 #1 1 1
 328 def R checkride #0 #1 1 0
 329 def Q fn B #0 #1 or fn R #0 #1
 330 def K checkleap #0 #1 1 1 or checkleap #0 #1 1 0
 331 def M fn N #0 #1 or fn R #0 #1
 332 def A fn N #0 #1 or fn B #0 #1
 333 def n checkleap #0 #1 1 2
 334 def b checkride #0 #1 1 1
 335 def r checkride #0 #1 1 0
 336 def q fn b #0 #1 or fn r #0 #1
 337 def k checkleap #0 #1 1 1 or checkleap #0 #1 1 0
 338 def m fn n #0 #1 or fn r #0 #1
 339 def a fn n #0 #1 or fn b #0 #1
 340 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
 341 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
 342 sub capturep p
 343   empty #p
 344   return true
 345 endsub
 346 sub checks king
 347   if not dest
 348     return false
 349   endif
 350   my checks c
 351   set checks ()
 352   if fn space dest dest #king
 353     setelem checks dest space dest
 354   endif
 355   set c sub checkedthru #king origin
 356   if #c
 357     setelem checks #c space #c
 358   elseif #epc
 359     set c sub checkedthru #king #epc
 360     if #c
 361       setelem checks #c space #c
 362     endif
 363   endif
 364   return var checks
 365 endsub
 366 sub checkmated king checks
 367   local from piece to key legalmove piece nopawn
 368   store
 369   if isupper space #king
 370     def friends onlyupper
 371     def friend isupper #0
 372     set attacked ATTACKEDBYB
 373   else
 374     def friends onlylower
 375     def friend islower #0
 376     set attacked ATTACKEDBYW
 377   endif
 378   set kingmoves fn KL #king
 379   for to #kingmoves
 380     if not fn friend space #to and onboard #to
 381       move #king #to
 382       set incheck fn var attacked #to
 383       restore
 384       if not #incheck
 385         setlegal #king #to
 386       endif
 387     endif
 388   next
 389   if == count var checks 1
 390     for (key enemy) var checks
 391       set possible path #king #key
 392       push possible #key
 393       if == #key #ep
 394         push possible cond isupper space #ep where #ep 0 -1 where #ep 0 1
 395       endif
 396       for (from piece) fn friends
 397         if == #from #king
 398           continue
 399         endif
 400         for to #possible
 401           if fn #piece #from #to
 402             move #from #to
 403             set incheck fn var attacked #king
 404             if not #incheck
 405               setlegal #from #to
 406             endif
 407           endif
 408           restore
 409         next
 410       next
 411     next
 412   endif
 413   return cond count system legalmoves false true and checks
 414 endsub
 415 def PL array where #0 0 2 where #0 0 1 where #0 -1 1 where #0 1 1
 416 def pL array where #0 0 -2 where #0 0 -1 where #0 -1 -1 where #0 1 -1
 417 def NL leaps #0 1 2
 418 def BL rays #0 1 1
 419 def RL rays #0 1 0
 420 def VL rays #0 1 1
 421 def CL rays #0 1 0
 422 def QL merge rays #0 1 0 rays #0 1 1
 423 def KL merge leaps #0 1 0 leaps #0 1 1
 424 def AL merge leaps #0 1 2 rays #0 1 1
 425 def ML merge rays #0 1 0 leaps #0 1 2
 426 def nL leaps #0 1 2
 427 def bL rays #0 1 1
 428 def rL rays #0 1 0
 429 def vL rays #0 1 1
 430 def cL rays #0 1 0
 431 def qL merge rays #0 1 0 rays #0 1 1
 432 def kL merge leaps #0 1 0 leaps #0 1 1
 433 def aL merge leaps #0 1 2 rays #0 1 1
 434 def mL merge rays #0 1 0 leaps #0 1 2
 435 sub castlepos from to
 436   local c RPOS RDEST xdir safe
 437   verify flag #from
 438   verify empty #to
 439   if isupper space #king
 440     def friend isupper #0
 441     def friends onlyupper
 442     set attacked ATTACKEDBYB
 443   else
 444     def friend islower #0
 445     def friends onlylower
 446     set attacked ATTACKEDBYW
 447   endif
 448   set xdir sign minus file #to file #from
 449   verify checkaride #from #to #xdir 0
 450   verify not fn var attacked #from
 451   set c #to
 452   do
 453     set c where #c #xdir 0
 454     if flag #c
 455       break
 456     endif
 457     verify onboard #c
 458     verify empty #c
 459   loop
 460   verify flag #c
 461   set RPOS #c
 462   store
 463   for c path #from #to
 464     move #from #c
 465     set safe not fn var attacked #c
 466     restore
 467     verify #safe
 468   next
 469   move #from #to
 470   set RDEST where #to neg #xdir 0
 471   move #RPOS #RDEST
 472   return true
 473 endsub
 474 sub stalemated king
 475   local legalmove temp from piece to attacked ra
 476   if isupper space #king
 477     def friend isupper #0
 478     def friends onlyupper
 479     set attacked ATTACKEDBYB
 480     set cspaces var wcastle
 481   else
 482     def friend islower #0
 483     def friends onlylower
 484     set attacked ATTACKEDBYW
 485     set cspaces var bcastle
 486   endif
 487   store
 488   set kingmoves fn KL #king
 489   for to #kingmoves
 490     if not fn friend space #to and onboard #to
 491       move #king #to
 492       set incheck fn var attacked #to
 493       restore
 494       if not #incheck
 495         setlegal #king #to
 496       endif
 497     endif
 498   next
 499   for to var cspaces
 500     if sub castlepos #king #to
 501       set incheck fn var attacked #to
 502       restore
 503       if not #incheck
 504         setlegal #king #to
 505       endif
 506     endif
 507   next
 508   restore
 509   for (from piece) fn friends
 510     if == #from #king
 511       continue
 512     endif
 513     for to fn join #piece L #from
 514       if fn #piece #from #to and not fn friend space #to and onboard #to
 515         move #from #to
 516         set incheck fn var attacked #king
 517         if not #incheck
 518           setlegal #from #to
 519         endif
 520       endif
 521       restore
 522     next
 523   next
 524   return cond count system legalmoves false true
 525 endsub
 526 def WPAWN match P what #0 1 -1 what #0 -1 -1
 527 def BPAWN match p what #0 1 1 what #0 -1 1
 528 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
 529 def WAZIR check what #0 0 -1 check what #0 -1 0 check what #0 0 1 check what #0 1 0 target #1
 530 def FERZ check what #0 -1 -1 check what #0 -1 1 check what #0 1 -1 check what #0 1 1 target #1
 531 def KING fn WAZIR #0 #1 or fn FERZ #0 #1
 532 def ROOK check insight #0 0 -1 check insight #0 -1 0 check insight #0 0 1 check insight #0 1 0 target #1
 533 def BISHOP check insight #0 -1 -1 check insight #0 -1 1 check insight #0 1 -1 check insight #0 1 1 target #1
 534 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)
 535 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)
 536 sub P from to
 537   local ydir
 538   if == file #from file #to and not capture
 539     set legal checkaleap #from #to 0 1
 540     if var legal
 541       set ep false
 542     else
 543       set legal checkaride #from #to 0 1 and <= distance #from #to #fps and or == rankname #from #wpr < #wpr 0
 544       set ep #to
 545     endif
 546     set epc false
 547   elseif capture or #ep
 548     set legal checkaleap #from #to -1 1 or checkaleap #from #to 1 1
 549     set epc false
 550     if not capture and var legal
 551       set legal > rank #to rank #ep and < rankname #to #bpr and == file #to file #ep
 552       if var legal
 553         capture #ep
 554         set epc #ep
 555       endif
 556     endif
 557     set ep false
 558   endif
 559   if != space #to moved and onboard where #to 0 #pzs
 560     die "You may not promote a Pawn until it reaches the promotion zone."
 561   endif
 562   if not onboard where #to 0 1
 563     if == P space #to
 564       askpromote #wprom
 565     elseif not match space #to var wprom
 566       set np space #to
 567       die "You may not promote your Pawn to a" #np
 568     endif
 569   endif
 570 endsub
 571 sub p from to
 572   if == file #from file #to and not capture
 573     set legal checkaleap #from #to 0 -1
 574     if var legal
 575       set ep false
 576     else
 577       set legal checkaride #from #to 0 -1 and <= distance #from #to #fps and or == rankname #from #bpr > #bpr lastrank
 578       set ep #to
 579     endif
 580     set epc false
 581   elseif capture or #ep
 582     set legal checkaleap #from #to -1 -1 or checkaleap #from #to 1 -1
 583     set epc false
 584     if not capture and var legal
 585       set legal < rank #to rank #ep and > rankname #to #wpr and == file #to file #ep
 586       if var legal
 587         capture #ep
 588         set epc #ep
 589       endif
 590     endif
 591     set ep false
 592   endif
 593   if != space #to moved and onboard where #to 0 neg #pzs
 594     die You may not promote a Pawn until it reaches the promotion zone.
 595   endif
 596   if not onboard where #to 0 -1
 597     if == p space #to
 598       askpromote #bprom
 599     elseif not match space #to var bprom
 600       set np space #to
 601       die You may not promote your Pawn to a #np
 602     endif
 603   endif
 604 endsub
 605 sub K from to
 606   if match #to var wcastle and flag #from
 607     set legal sub castle
 608   else
 609     set legal fn K #from #to
 610   endif
 611   set K #to
 612   unsetflag e1
 613 endsub
 614 sub k from to
 615   if match #to var bcastle and flag #from
 616     set legal sub castle
 617   else
 618     set legal fn k #from #to
 619   endif
 620   set k #to
 621   unsetflag e8
 622 endsub
 623 sub castle
 624   local ATTACKED c RPOS RDEST xdir
 625   if not flag #from
 626     die A King may not castle after it moves.
 627   endif
 628   if capture
 629     die A King may not castle to an occupied space.
 630   endif
 631   set xdir sign minus file #to file #from
 632   if not checkaride #from #to #xdir 0
 633     die A King may not castle across any occupied space.
 634   endif
 635   set c #to
 636   do
 637     set c where #c #xdir 0
 638     if flag #c
 639       break
 640     elseif not onboard #c
 641       die No piece was found to castle with.
 642     elseif not empty #c
 643       die The King cannot castle with the piece at #c
 644     endif
 645   loop
 646   set RPOS #c
 647   set ATTACKED ATTACKEDBYW unless isupper moved ATTACKEDBYB
 648   if fn var ATTACKED #from
 649     die A King may not castle out of check.
 650   endif
 651   for c path #from #to
 652     if fn var ATTACKED #c
 653       die A King may not castle through check.
 654     endif
 655   next
 656   if == count var subargs 0
 657     set RDEST where #to neg #xdir 0
 658   else
 659     set RDEST elem 0 subarg
 660   endif
 661   unsetflag #RPOS
 662   move #RPOS #RDEST
 663   return true
 664 endsub
 665 sub checkedthru king loc
 666   my dir c
 667   set c revealed #king #loc
 668   verify fn space #c #c #king and not samecase space #king space #c and onboard #c and #c
 669   return #c
 670 endsub
 671 def fn checkedfrom fn space #1 #0 and xor isupper space #0 isupper space #1 and not empty #1
 672 sub P1 from to
 673   if == file #from file #to
 674     return not capture
 675   elseif capture
 676     return true
 677   elseif == file #to file #ep and == rank #from rank #ep and #ep
 678     capture #ep
 679     return true
 680   endif
 681   return false
 682 endsub
 683 sub PP from to
 684   if checkatwostep #from #to 0 1 0 1 or checkaleap #from #to 0 1
 685     return empty #to
 686   elseif not checkaleap #from #to 1 1 and not checkaleap #from #to -1 1
 687     return false
 688   elseif not empty #to
 689     return true
 690   elseif == file #to file #ep and == rank #from rank #ep and #ep
 691     capture #ep
 692     return true
 693   endif
 694   return false
 695 endsub
 696 sub pp from to
 697   if checkatwostep #from #to 0 -1 0 -1 or checkaleap #from #to 0 -1
 698     return empty #to
 699   elseif not checkaleap #from #to 1 -1 and not checkaleap #from #to -1 -1
 700     return false
 701   elseif not empty #to
 702     return true
 703   elseif == file #to file #ep and == rank #from rank #ep and #ep
 704     capture #ep
 705     return true
 706   endif
 707   return false
 708 endsub
 709 endlib