Syntax Error on line 1

Unknown error concerning the definition of subroutine postauto1.

Edit the Settings File for Crooked Knightrider 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 alias CN _MLV_CNNL cn _mlv_cnnl
   1 sub postauto1
   2   set legal false
   3   if or isupper old fn _MLV_CNNL old
   4     die You may not capture your own pieces.
   5   elseif islower moved
   6     die You may not move one of your opponent's pieces.
   7   endif
   8   if equal moved P
   9     if not capture
  10       set  legal checkaleap origin dest 0 1
  11       if not var legal
  12         set legal and equal rankname origin 2 checkatwostep origin dest 0 1 0 1
  13       endif
  14       if not var legal
  15         set legal and equal rankname origin 5
or checkaleap origin dest 1 1
checkaleap origin dest neg 1 1
  16         if var legal
  17           if equal filename dest a
  18             capture a5
  19           elseif equal filename dest b
  20             capture b5
  21           elseif equal filename dest c
  22             capture c5
  23           elseif equal filename dest d
  24             capture d5
  25           elseif equal filename dest e
  26             capture e5
  27           elseif equal filename dest f
  28             capture f5
  29           elseif equal filename dest g
  30             capture g5
  31           elseif equal filename dest h
  32             capture h5
  33           elseif equal filename dest i
  34             capture i5
  35           elseif equal filename dest j
  36             capture j5
  37           endif
  38         endif
  39       endif
  40     else
  41       set legal or checkaleap origin dest 1 1 checkaleap origin dest neg 1 1
  42     endif
  43     if and var legal and equal rankname dest 8 not or equal Q space dest or equal _MLV_CNNL space dest or equal R space dest or equal B space dest equal N space dest
  44       askpromote Q _MLV_CNNL R B N
  45       if sub moved origin dest and match moved P K
  46       elseif fn moved origin dest and match moved Q A _MLV_CNNL R B N
  47       else
  48         die Illegal move!
  49       endif
  50     elseif equal moved N
  51       set legal checkleap origin dest 1 2
  52     elseif equal moved B
  53       set legal checkride origin dest 1 1
  54     elseif equal moved R
  55       set legal checkride origin dest 1 0
  56     elseif equal moved Q
  57       set legal or checkride origin dest 1 1 checkride origin dest 1 0
  58     elseif equal moved A
  59       set legal or checkride origin dest 1 1 checkleap origin dest 1 2
  60     elseif equal moved _MLV_CNNL
  61       set legal logride origin dest (cn1 cn2 cn1 cn2 cn1 cn2 cn1 cn2 cn1 cn2 cn1 cn2 cn1 cn2 cn1 cn2)(cn2 cn1 cn2 cn1 cn2 cn1 cn2 cn1 cn2 cn1 cn2 cn1 cn2 cn1 cn2 cn1)(cn1 cn3 cn1 cn3 cn1 cn3 cn1 cn3 cn1 cn3 cn1 cn3 cn1 cn3 cn1 cn3)(cn3 cn1 cn3 cn1 cn3 cn1 cn3 cn1 cn3 cn1 cn3 cn1 cn3 cn1 cn3 cn1)(cn4 cn3 cn4 cn3 cn4 cn3 cn4 cn3 cn4 cn3 cn4 cn3 cn4 cn3 cn4 cn3)(cn3 cn4 cn3 cn4 cn3 cn4 cn3 cn4 cn3 cn4 cn3 cn4 cn3 cn4 cn3 cn4)(cn4 cn2 cn4 cn2 cn4 cn2 cn4 cn2 cn4 cn2 cn4 cn2 cn4 cn2 cn4 cn2)(cn2 cn4 cn2 cn4 cn2 cn4 cn2 cn4 cn2 cn4 cn2 cn4 cn2 cn4 cn2 cn4)
  62     elseif equal moved K
  63       set legal or checkleap origin dest 1 1 checkleap origin dest 1 0
  64       if not var legal
  65         if equal rankname origin 1
  66           if equal file dest 8
  67             empty j1
  68             add R h1
  69             set legal true
  70           elseif equal file dest 2
  71             empty a1
  72             add R d1
  73             set legal true
  74           endif
  75         endif
  76       endif
  77     endif
  78     if not var legal
  79       die Illegal move!
  80     endif
  81   endsub
  82   sub postauto2
  83     set legal false
  84     if or islower old equal fn _mlv_cnnl old
  85       die You may not capture your own pieces.
  86     elseif isupper moved
  87       die You may not move one of your opponent's pieces.
  88     endif
  89     if equal moved p
  90       if not capture
  91         set  legal checkaleap origin dest 0 neg 1
  92         if not var legal
  93           set legal and equal rankname origin 7 checkatwostep origin dest 0 neg 1 0 neg 1
  94         endif
  95         if not var legal
  96           set legal and equal rankname origin 4
or checkaleap origin dest 1 neg 1
checkaleap origin dest neg 1 neg 1
  97           if var legal
  98             if equal filename dest a
  99               capture a4
 100             elseif equal filename dest b
 101               capture b4
 102             elseif equal filename dest c
 103               capture c4
 104             elseif equal filename dest d
 105               capture d4
 106             elseif equal filename dest e
 107               capture e4
 108             elseif equal filename dest f
 109               capture f4
 110             elseif equal filename dest g
 111               capture g4
 112             elseif equal filename dest h
 113               capture h4
 114             elseif equal filename dest i
 115               capture i4
 116             elseif equal filename dest j
 117               capture j4
 118             endif
 119           endif
 120         endif
 121       else
 122         set legal or checkaleap origin dest 1 neg 1 checkaleap origin dest neg 1 neg 1
 123       endif
 124       if and var legal and equal rankname dest 1 not or equal q space dest or equal _MW_ma space dest or equal r space dest or equal b space dest equal n space dest
 125         askpromote q _mlv_cnnl r b n
 126         if sub moved origin dest and match moved p k
 127         elseif fn moved origin dest and match moved q a _mlv_cnnl r b n
 128         else
 129           die Illegal move!
 130         endif
 131         def _mlv_cnnl fn _MLV_CNNL #0 #1
 132       elseif equal moved n
 133         set legal checkleap origin dest 1 2
 134       elseif equal moved b
 135         set legal checkride origin dest 1 1
 136       elseif equal moved r
 137         set legal checkride origin dest 1 0
 138       elseif equal moved q
 139         set legal or checkride origin dest 1 1 checkride origin dest 1 0
 140       elseif equal moved a
 141         set legal or checkride origin dest 1 1 checkleap origin dest 1 2
 142       elseif equal moved _mlv_cnnl
 143         set legal logride origin dest (cn1 cn2 cn1 cn2 cn1 cn2 cn1 cn2 cn1 cn2 cn1 cn2 cn1 cn2 cn1 cn2)(cn2 cn1 cn2 cn1 cn2 cn1 cn2 cn1 cn2 cn1 cn2 cn1 cn2 cn1 cn2 cn1)(cn1 cn3 cn1 cn3 cn1 cn3 cn1 cn3 cn1 cn3 cn1 cn3 cn1 cn3 cn1 cn3)(cn3 cn1 cn3 cn1 cn3 cn1 cn3 cn1 cn3 cn1 cn3 cn1 cn3 cn1 cn3 cn1)(cn4 cn3 cn4 cn3 cn4 cn3 cn4 cn3 cn4 cn3 cn4 cn3 cn4 cn3 cn4 cn3)(cn3 cn4 cn3 cn4 cn3 cn4 cn3 cn4 cn3 cn4 cn3 cn4 cn3 cn4 cn3 cn4)(cn4 cn2 cn4 cn2 cn4 cn2 cn4 cn2 cn4 cn2 cn4 cn2 cn4 cn2 cn4 cn2)(cn2 cn4 cn2 cn4 cn2 cn4 cn2 cn4 cn2 cn4 cn2 cn4 cn2 cn4 cn2 cn4)
 144       elseif equal moved k
 145         set legal or checkleap origin dest 1 1 checkleap origin dest 1 0
 146         if not var legal
 147           if equal rankname origin 8
 148             if equal file dest 8
 149               empty j8
 150               add r h8
 151               set legal true
 152             elseif equal file dest 2
 153               empty a8
 154               add r d8
 155               set legal true
 156             endif
 157           endif
 158         endif
 159       endif
 160     endsub
 161     end
 162     

functions

uservar

Array ( [0] => Array ( [main] => Array ( ) ) )

mline

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

allmoves

Array ( )

movelist

constants

Array ( )