66

BANNED INPUT: draw on turn 34:

There is a global ban on commands in user input, and no exception has been made for the draw command on the part of the turn indexed 1.

Go back and try again.

What is otherwise valid user input in Game Courier can be banned in a GAME Code program for the sake of better enforcing the rules. See "Restricting User Input" in the Game Courier Developer's Guide for details on how this is done.

If you believe that your input should not have been banned, contact Fergus Duniho or whoever programmed the rules for this game.

Edit Settings File
   0 set g findpiece g spaces
   1 set G findpiece G spaces
   2 include xiangqi
   3 setflag rules
   4 sub postauto1
   5   if islower moved
   6     die You may not move your opponent's pieces.
   7   elseif isupper old
   8     die You may not capture your own pieces.
   9   elseif not fn moved origin dest
  10     die You may not move a moved from origin to dest
  11   endif
  12   if == moved G
  13     set G dest
  14   endif
  15   if sub checked #G
  16     die You may not move your General into check
  17   endif
  18 endsub
  19 sub postauto2
  20   if isupper moved
  21     die You may not move your opponent's pieces.
  22   elseif islower old
  23     die You may not capture your own pieces.
  24   elseif not fn moved origin dest
  25     die You may not move a moved from origin to dest
  26   endif
  27   if == moved g
  28     set g dest
  29   endif
  30   if sub checked #g
  31     die You may not move your General into check
  32   endif
  33 endsub
  34 moveindex 0
  35 MOVE: C h3-e3
  36 postauto1
  37 moveindex 1
  38 MOVE: n b10-c8
  39 postauto2
  40 moveindex 2
  41 MOVE: N b1-c3
  42 postauto1
  43 moveindex 3
  44 MOVE: e c10-e8
  45 postauto2
  46 moveindex 4
  47 MOVE: i4-i5
  48 postauto1
  49 moveindex 5
  50 MOVE: p c7-c6
  51 postauto2
  52 moveindex 6
  53 MOVE: N h1-i3
  54 postauto1
  55 moveindex 7
  56 MOVE: n h10-g8
  57 postauto2
  58 moveindex 8
  59 MOVE: N i3-h5
  60 postauto1
  61 moveindex 9
  62 MOVE: c h8-h6
  63 postauto2
  64 moveindex 10
  65 MOVE: N h5-f6
  66 postauto1
  67 moveindex 11
  68 MOVE: r i10-i8
  69 postauto2
  70 moveindex 12
  71 MOVE: C e3-g3
  72 postauto1
  73 moveindex 13
  74 MOVE: p g7-g6
  75 postauto2
  76 moveindex 14
  77 MOVE: N f6-d7
  78 postauto1
  79 moveindex 15
  80 MOVE: r a10-a9
  81 postauto2
  82 moveindex 16
  83 MOVE: N d7-b8
  84 postauto1
  85 moveindex 17
  86 MOVE: r a9 -a8
  87 postauto2
  88 moveindex 18
  89 MOVE: g4-g5
  90 postauto1
  91 moveindex 19
  92 MOVE: r a8-b8
  93 postauto2
  94 moveindex 20
  95 MOVE: C b3-b5
  96 postauto1
  97 moveindex 21
  98 MOVE: r b8-b5
  99 postauto2
 100 moveindex 22
 101 MOVE: g5-g6
 102 postauto1
 103 moveindex 23
 104 MOVE: e e8-g6
 105 postauto2
 106 moveindex 24
 107 MOVE: R a1-b1
 108 postauto1
 109 moveindex 25
 110 MOVE: r b5-b1
 111 postauto2
 112 moveindex 26
 113 MOVE: N c3-b1
 114 postauto1
 115 moveindex 27
 116 MOVE: n c8-d6
 117 postauto2
 118 moveindex 28
 119 MOVE: C g3-g8
 120 postauto1
 121 moveindex 29
 122 MOVE: r i8-g8
 123 postauto2
 124 moveindex 30
 125 MOVE: i5-i6
 126 postauto1
 127 moveindex 31
 128 MOVE: p i7-i6
 129 postauto2
 130 moveindex 32
 131 MOVE: N b1-a3
 132 postauto1
 133 moveindex 33
 134 MOVE: n d6-e4
 135 postauto2
 136 moveindex 34
 137 MOVE: R i1-i6
 138 postauto1
 139 moveindex 35
 140 MOVE: c h6-h1
 141 postauto2
 142 moveindex 36
 143 MOVE: F d1-e2
 144 postauto1
 145 moveindex 37
 146 MOVE: e g6-e8
 147 postauto2
 148 moveindex 38
 149 MOVE: E c1-e3
 150 postauto1
 151 moveindex 39
 152 MOVE: r g8-g2
 153 postauto2
 154 moveindex 40
 155 MOVE: R i6-h6
 156 postauto1
 157 moveindex 41
 158 MOVE: c h1-i1
 159 postauto2
 160 moveindex 42
 161 MOVE: R h6-h1
 162 postauto1
 163 moveindex 43
 164 MOVE: c i1-i3
 165 postauto2
 166 moveindex 44
 167 MOVE: E g1-i3
 168 postauto1
 169 moveindex 45
 170 MOVE: p e7-e6
 171 postauto2
 172 moveindex 46
 173 MOVE: a4-a5
 174 postauto1
 175 moveindex 47
 176 MOVE: p e6-e5
 177 postauto2
 178 moveindex 48
 179 MOVE: N a3-b5
 180 postauto1
 181 moveindex 49
 182 MOVE: n e4-g3
 183 postauto2
 184 moveindex 50
 185 MOVE: N b5-d6
 186 postauto1
 187 moveindex 51
 188 MOVE: p e5-e4
 189 postauto2
 190 moveindex 52
 191 MOVE: R h1-g1
 192 postauto1
 193 moveindex 53
 194 MOVE: r g2-g1
 195 postauto2
 196 moveindex 54
 197 MOVE: E e3-g1
 198 postauto1
 199 moveindex 55
 200 MOVE: p e4-d4
 201 postauto2
 202 moveindex 56
 203 MOVE: E i3-g5
 204 postauto1
 205 moveindex 57
 206 MOVE: p d4-c4
 207 postauto2
 208 moveindex 58
 209 MOVE: N d6-c4
 210 postauto1
 211 moveindex 59
 212 MOVE: p c6-c5
 213 postauto2
 214 moveindex 60
 215 MOVE: N c4-e5
 216 postauto1
 217 moveindex 61
 218 MOVE: f d10-e9
 219 postauto2
 220 moveindex 62
 221 MOVE: N e5-d7
 222 postauto1
 223 moveindex 63
 224 MOVE: p c5-c4
 225 postauto2
 226 moveindex 64
 227 MOVE: N d7-c5
 228 postauto1
 229 moveindex 65
 230 MOVE: g e10-d10
 231 postauto2
 232 moveindex 66
 233 MOVE: draw
 234 postauto1
 235 moveindex 67
 236 MOVE: draw
 237 postauto2
 238 moveindex 68
 239 MOVE: draw agreed
 240 postauto1
 241 moveindex 69
 242 MOVE: draw agreed
 243 postauto2
 244 moveindex 70
 245 MOVE: drawn
 246 postauto1
 247 if sub stalemated #g
 248   if sub checked #g
 249     say Checkmate! Red has won!
 250   else
 251     say Stalemate! Red has won!
 252   endif
 253   won
 254 elseif sub checked #g
 255   say Check!
 256 endif
 257 end
 258 
 259 lib xiangqi
 260 setsystem maxmove 1
 261 ban commands allmoves
 262 allow moves 1 captures 1
 263 setflag d1 e1 f1 d2 e2 f2 e3 d3 f3 d8 e8 f8 d9 e9 f9 d10 e10 f10
 264 def N checktwostep #0 #1 0 1 1 1
 265 def P checkaleap #0 #1 -1 0 or checkaleap #0 #1 1 0 and > rank #0 4 or checkaleap #0 #1 0 1
 266 def R checkride #0 #1 0 1
 267 def E checktwostep #0 #1 1 1 1 1 and < rank #1 5
 268 def C cond cond empty #0 capture (not empty #1) (checkhop #0 #1 0 1) (checkride #0 #1 0 1) and #1
 269 def G checkride #0 #1 1 0 and == space #1 g or checkleap #0 #1 0 1 and flag #1
 270 def F checkleap #0 #1 1 1 and flag #1
 271 def n checktwostep #0 #1 0 1 1 1
 272 def p checkaleap #0 #1 -1 0 or checkaleap #0 #1 1 0 and < rank #0 5 or checkaleap #0 #1 0 -1
 273 def r checkride #0 #1 0 1
 274 def e checktwostep #0 #1 1 1 1 1 and > rank #1 4
 275 def c cond cond empty #0 capture (not empty #1) (checkhop #0 #1 0 1) (checkride #0 #1 0 1) and #1
 276 def g checkride #0 #1 1 0 and == space #1 G or checkleap #0 #1 0 1 and flag #1
 277 def f checkleap #0 #1 1 1 and flag #1
 278 sub checked general
 279   local piece from
 280   if isupper space #general
 281     def enemies onlylower
 282   else
 283     def enemies onlyupper
 284   endif
 285   for (from piece) fn enemies
 286     if fn #piece #from #general
 287       return true
 288     endif
 289   next
 290   return false
 291 endsub
 292 sub stalemated kingpos
 293   store
 294   local from piece to key lglmvs
 295   set lglmvs ()
 296   if isupper space #kingpos
 297     def friends onlyupper
 298     def nofriends noupper
 299     def friend isupper #0
 300   else
 301     def friends onlylower
 302     def nofriends nolower
 303     def friend islower #0
 304   endif
 305   set royal space var kingpos
 306   store
 307   for to fn join #royal L #kingpos
 308     if fn #royal #kingpos #to and not fn friend space #to and onboard #to
 309       move #kingpos #to
 310       set incheck sub checked #to
 311       restore
 312       if not #incheck
 313         setlegal #kingpos #to
 314       endif
 315     endif
 316   next
 317   restore
 318   for (from piece) fn friends
 319     if == #from #kingpos
 320       continue
 321     endif
 322     for to fn join #piece L #from
 323       if fn #piece #from #to and not fn friend space #to and onboard #to
 324         move #from #to
 325         set incheck sub checked #kingpos
 326         restore
 327         if not #incheck
 328           setlegal #from #to
 329         endif
 330       endif
 331     next
 332   next
 333   return cond count system legalmoves false true
 334 endsub
 335 def PL leaps #0 1 0
 336 def EL leaps #0 2 2
 337 def RL rays #0 1 0
 338 def CL rays #0 1 0
 339 def GL merge leaps #0 1 0 (#g #G)
 340 def FL leaps #0 1 1
 341 def NL leaps #0 1 2
 342 def pL leaps #0 -1 0
 343 def eL leaps #0 2 2
 344 def rL rays #0 1 0
 345 def cL rays #0 1 0
 346 def gL merge leaps #0 1 0 (#G #g)
 347 def fL leaps #0 1 1
 348 def nL leaps #0 1 2
 349 endlib