Syntax Error on line 42

The equal operator requires at least two arguments.

Edit the Settings File for Long Chess with Weird Pieces

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 mr _jg_mr MR _JG_MR
   1 set k findpiece k spaces K findpiece K spaces
   2 set wcastle c1 j1
   3 set bcastle c8 j8
   4 sub checked king
   5   my from piece
   6   if debug
   7     print ""
   8     dump
   9     print ""
  10   endif
  11   if isupper cond empty #king moved space #king
  12     def enemies onlylower or equal .gif or equal .giw or equal _jg_mr
  13   else
  14     def enemies onlyupper or equal .GIF or equal .GIW or equal _JG_MR
  15   endif
  16   for (from piece) fn enemies
  17     if equal #piece #from #king
  18       if debug
  19         dump
  20       endif
  21       return #from
  22     endif
  23   next
  24   return false
  25 endsub
  26 sub stalemated kingpos
  27   store
  28   local from piece to
  29   if isupper space #kingpos
  30     def friends onlyupper or equal .GIF or equal .GIW or equal _JG_MR
  31     def nofriends noupper
  32     def friend merge merge merge isupper #0 equal .GIF #0 equal .GIW #0 equal _JG_MR #0
  33     set cspaces var wcastle
  34   else
  35     def friends onlylower or equal .gif or equal .giw or equal _jg_mr
  36     def nofriends nolower
  37     def friend merge merge merge islower #0 equal .gif #0 equal .giw #0 equal _jg_mr #0
  38     set cspaces var bcastle
  39   endif
  40   set royal space var kingpos
  41   store
  42   for (from piece) fn friends
  43     for to fn join #piece L #from
  44       if fn #piece #from #to and not fn friend space #to and onboard #to
  45         move #from #to
  46         if not sub checked cond == #from #kingpos #to #kingpos
  47           setlegal #from #to
  48         endif
  49       endif
  50       restore
  51     next
  52   next
  53   for to var cspaces
  54     if sub castlepos #kingpos #to
  55       if not sub checked #to
  56         setlegal #kingpos #to
  57       endif
  58     endif
  59     restore
  60   next
  61   return cond count system legalmoves false true
  62 endsub
  63 sub castle
  64   local c RPOS RDEST xdir
  65   if not flag #from
  66     die A King may not castle after it moves.
  67   endif
  68   if capture
  69     die A King may not castle to an occupied space.
  70   endif
  71   set xdir sign minus file #to file #from
  72   if not checkaride #from #to #xdir 0
  73     die A King may not castle across any occupied space.
  74   endif
  75   set c #to
  76   do
  77     set c where #c #xdir 0
  78     if flag #c
  79       break
  80     elseif not onboard #c
  81       die No piece was found to castle with.
  82     elseif not empty #c
  83       die The King cannot castle with the piece at #c
  84     endif
  85   loop
  86   set RPOS #c
  87   move #to #from
  88   if sub checked #from
  89     die A King may not castle out of check.
  90   endif
  91   store
  92   for c path #from #to
  93     move #from #c
  94     if sub checked #c
  95       die A King may not castle through check.
  96     endif
  97     restore
  98   next
  99   if debug
 100     echo ""
 101     dump
 102     echo ""
 103   endif
 104   move #from #to
 105   if == count var subargs 0
 106     set RDEST where #to neg #xdir 0
 107   else
 108     set RDEST elem 0 subargs
 109   endif
 110   unsetflag #RPOS
 111   move #RPOS #RDEST
 112   return true
 113 endsub
 114 sub castlepos from to
 115   local c RPOS RDEST xdir safe
 116   verify flag #from
 117   verify empty #to
 118   set xdir sign minus file #to file #from
 119   verify checkaride #from #to #xdir 0
 120   verify not sub checked #from
 121   set c #to
 122   do
 123     set c where #c #xdir 0
 124     if flag #c
 125       break
 126     endif
 127     verify onboard #c
 128     verify empty #c
 129   loop
 130   verify flag #c
 131   set RPOS #c
 132   store
 133   for c path #from #to
 134     move #from #c
 135     set safe not sub checked #c
 136     restore
 137     verify #safe
 138   next
 139   move #from #to
 140   set RDEST where #to neg #xdir 0
 141   move #RPOS #RDEST
 142   return true
 143 endsub
 144 def rL rays #0 0 1
 145 def nL leaps #0 1 2
 146 def bL rays #0 1 1
 147 def qL merge rays #0 1 1 rays #0 0 1
 148 def kL merge leaps #0 1 1 leaps #0 0 1
 149 def pL array where #0 0 -2 where #0 0 -1 where #0 -1 -1 where #0 1 -1
 150 sub postauto1
 151   set legal false
 152   if or isupper old or equal .GIF old or equal .GIW old equal _JG_MR old
 153     die You may not capture your own pieces.
 154   endif
 155   if equal moved P
 156     if not capture
 157       set  legal checkaleap origin dest 0 1
 158       if not var legal
 159         set legal and equal rankname origin 2 checkatwostep origin dest 0 1 0 1
 160       endif
 161       if not var legal
 162         set legal and equal rankname origin 5
or checkaleap origin dest 1 1
checkaleap origin dest neg 1 1
 163         if var legal
 164           if equal filename dest a
 165             capture a5
 166           elseif equal filename dest b
 167             capture b5
 168           elseif equal filename dest c
 169             capture c5
 170           elseif equal filename dest d
 171             capture d5
 172           elseif equal filename dest e
 173             capture e5
 174           elseif equal filename dest f
 175             capture f5
 176           elseif equal filename dest g
 177             capture g5
 178           elseif equal filename dest h
 179             capture h5
 180           elseif equal filename dest i
 181             capture i5
 182           elseif equal filename dest j
 183             capture j5
 184           elseif equal filename dest k
 185             capture k5
 186           elseif equal filename dest l
 187             capture l5
 188           endif
 189         endif
 190       endif
 191     else
 192       set legal or checkaleap origin dest 1 1 checkaleap origin dest neg 1 1
 193     endif
 194     if and var legal and equal rankname dest 8 not or equal Q space dest or equal _JG_MR space dest or equal .GIF space dest or equal .GIW space dest or equal R space dest or equal B space dest equal N space dest
 195       askpromote Q _JG_MR .GIF .GIW R B N
 196     endif
 197   elseif equal moved N
 198     set legal checkleap origin dest 1 2
 199   elseif equal moved B
 200     set legal checkride origin dest 1 1
 201   elseif equal moved R
 202     set legal checkride origin dest 1 0
 203   elseif equal moved Q
 204     set legal or checkride origin dest 1 1 checkride origin dest 1 0
 205   elseif equal moved .GIF
 206     set legal or checkleap origin dest 1 1 checkleap origin dest 1 4
 207   elseif equal moved .GIW
 208     set legal or checkleap origin dest 0 1 checkleap origin dest 1 4
 209   elseif equal moved _JG_MR
 210     set legal or checkleap origin dest 2 2 or checkleap origin dest 3 3
checkleap origin dest 0 2
 211   elseif equal moved K
 212     set legal or checkleap origin dest 1 1 checkleap origin dest 1 0
 213     if not var legal
 214       if equal rankname origin 1
 215         if equal file dest 8
 216           empty j1
 217           add R h1
 218           set legal true
 219         elseif equal file dest 2
 220           empty a1
 221           add R d1
 222           set legal true
 223         endif
 224       endif
 225     endif
 226   endif
 227   if not var legal
 228     die Illegal move!
 229   endif
 230 endsub
 231 sub postauto2
 232   set legal false
 233   if or islower old or equal .gif old or equal .giw old equal _jg_mr old
 234     die You may not capture your own pieces.
 235   endif
 236   if equal moved p
 237     if not capture
 238       set  legal checkaleap origin dest 0 neg 1
 239       if not var legal
 240         set legal and equal rankname origin 7 checkatwostep origin dest 0 neg 1 0 neg 1
 241       endif
 242       if not var legal
 243         set legal and equal rankname origin 4
or checkaleap origin dest 1 neg 1
checkaleap origin dest neg 1 neg 1
 244         if var legal
 245           if equal filename dest a
 246             capture a4
 247           elseif equal filename dest b
 248             capture b4
 249           elseif equal filename dest c
 250             capture c4
 251           elseif equal filename dest d
 252             capture d4
 253           elseif equal filename dest e
 254             capture e4
 255           elseif equal filename dest f
 256             capture f4
 257           elseif equal filename dest g
 258             capture g4
 259           elseif equal filename dest h
 260             capture h4
 261           elseif equal filename dest i
 262             capture i4
 263           elseif equal filename dest j
 264             capture j4
 265           elseif equal filename dest k
 266             capture k4
 267           elseif equal filename dest l
 268             capture l4
 269           endif
 270         endif
 271       endif
 272     else
 273       set legal or checkaleap origin dest 1 neg 1 checkaleap origin dest neg 1 neg 1
 274     endif
 275     if and var legal and equal rankname dest 8 not or equal q space dest or equal _jg_mr space dest or equal .gif space dest or equal .giw space dest or equal r space dest or equal b space dest equal n space dest
 276       askpromote q _jg_mr .gif .giw r b n
 277     endif
 278   elseif equal moved n
 279     set legal checkleap origin dest 1 2
 280   elseif equal moved b
 281     set legal checkride origin dest 1 1
 282   elseif equal moved r
 283     set legal checkride origin dest 1 0
 284   elseif equal moved q
 285     set legal or checkride origin dest 1 1 checkride origin dest 1 0
 286   elseif equal moved .gif
 287     set legal or checkleap origin dest 1 1 checkleap origin dest 1 4
 288   elseif equal moved .giw
 289     set legal or checkleap origin dest 0 1 checkleap origin dest 1 4
 290   elseif equal moved _jg_mr
 291     set legal or checkleap origin dest 2 2 or checkleap origin dest 3 3
checkleap origin dest 0 2
 292   elseif equal moved k
 293     set legal or checkleap origin dest 1 1 checkleap origin dest 1 0
 294     if not var legal
 295       if equal rankname origin 8
 296         if equal file dest 8
 297           empty j8
 298           add r h8
 299           set legal true
 300         elseif equal file dest 2
 301           empty a8
 302           add r d8
 303           set legal true
 304         endif
 305       endif
 306     endif
 307   endif
 308   if not var legal
 309     die Illegal move!
 310   endif
 311 endsub
 312 set posvar join "b" join fencode boardflags
 313 if >= var #posvar 3
 314   say Three Times Repetition! Drawn Game!
 315   drawn
 316 elseif sub stalemated #K
 317   if sub checked #K
 318     say Checkmate! Black has won!
 319     won
 320   else
 321     say Stalemate! The game is drawn.
 322     drawn
 323   endif
 324 elseif >= #nopvc 100
 325   say Fifty Moves Without Moving a Pawn or Capturing! Game Drawn!
 326   drawn
 327 elseif sub checked #K
 328   say Check!
 329 endif
 330 end
 331 

functions

Array ( [rL] => Array ( [0] => rays [1] => #0 [2] => 0 [3] => 1 ) [nL] => Array ( [0] => leaps [1] => #0 [2] => 1 [3] => 2 ) [bL] => Array ( [0] => rays [1] => #0 [2] => 1 [3] => 1 ) [qL] => Array ( [0] => merge [1] => rays [2] => #0 [3] => 1 [4] => 1 [5] => rays [6] => #0 [7] => 0 [8] => 1 ) [kL] => Array ( [0] => merge [1] => leaps [2] => #0 [3] => 1 [4] => 1 [5] => leaps [6] => #0 [7] => 0 [8] => 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 ) [friends] => Array ( [0] => onlylower [1] => or [2] => equal [3] => .gif [4] => or [5] => equal [6] => .giw [7] => or [8] => equal [9] => _jg_mr ) [nofriends] => Array ( [0] => nolower ) [friend] => Array ( [0] => merge [1] => merge [2] => merge [3] => islower [4] => #0 [5] => equal [6] => .gif [7] => #0 [8] => equal [9] => .giw [10] => #0 [11] => equal [12] => _jg_mr [13] => #0 ) )

uservar

Array ( [0] => Array ( [main] => Array ( [k] => Array ( [0] => g1 [1] => g8 ) [wcastle] => Array ( [0] => j1 [1] => c1 ) [bcastle] => Array ( [0] => j8 [1] => c8 ) [posvar] => brnb{.gif}{_jg_mr}qk{_jg_mr}{.giw}bnrpppppppppppp48PPPPPPPPPPPPRNB{.GIW}{_JG_MR}QK{_JG_MR}{.GIF}BNR [cspaces] => Array ( [0] => j8 [1] => c8 ) [royal] => ) ) [2] => Array ( [stalemated] => Array ( [subargs] => Array ( [0] => #K ) ) [main] => Array ( [kingpos] => #K [from] => 0 [piece] => 0 [to] => 0 ) ) )

mline

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

allmoves

Array ( )

movelist

constants

Array ( )