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 63

checks is not the name of any known subroutine in your program

Edit the Settings File for Assymetric army

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 sub postauto1
   6   if isupper old
   7     die You may not capture your own pieces.
   8   endif
   9   if not equal moved P
  10     set ep false
  11     if unequal space dest moved
  12       die You may not change the type of this piece.
  13     endif
  14   endif
  15   set legal false
  16   if match moved P K
  17     gosub moved origin dest
  18     if equal moved K
  19       set K dest
  20     endif
  21   elseif match moved Q R B N A E F C I M D G L W J H
  22     set legal fn moved origin dest
  23     if match moved R A I L
  24       unsetflag origin
  25     endif
  26   endif
  27   if not var legal
  28     die You may not move a moved from origin to dest
  29   endif
  30   if fn ATTACKEDBYB #K
  31     die You may not move into check.
  32   endif
  33 endsub
  34 sub postauto2
  35   if islower old
  36     die You may not capture your own pieces.
  37   endif
  38   if not equal moved p
  39     set ep false
  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 a e f c i m d g l w j h
  51     set legal fn toupper moved origin dest
  52     if equal moved r a i l
  53       unsetflag origin
  54     endif
  55   endif
  56   if not var legal
  57     die You may not move a moved from origin to dest
  58   endif
  59   if fn ATTACKEDBYW #k
  60     die You may not move into check.
  61   endif
  62 endsub
  63 set checks sub checks #K
  64 if var checks
  65   if sub checkmated #K #checks
  66     say Checkmate! Black has won!
  67     won
  68   else
  69     say Check!
  70   endif
  71 elseif sub stalemated #K
  72   say Stalemate! The game is drawn.
  73   drawn
  74 endif
  75 end
  76 

functions

uservar

Array ( [0] => Array ( [main] => Array ( [k] => e8 [K] => e1 [ep] => ) ) )

mline

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

allmoves

Array ( )

movelist

constants

Array ( )