Please report any bugs or errors to H.G. Muller
Syntax Error on line 272
Missing both default and case "#rng" in switch
Edit the Settings File for Cetran Chess 3
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 include /membergraphics/MSplay-test-applet-for-chess-variants/betza.txt set legdefs (0 1 1 0 1 1 1 1 1 1 2 1 1 -1 1 2 1 1 0 2 16577 1 1 1 1 4 1 1 -1 1 4 0 1 1 0 -1 1 1 1 -1 -1 2 1 1 1 -1 2 1 1 0 -2 16577 1 1 -1 -1 4 1 1 1 -1 4 0 1 99 0 1 3 1 99 1 1 3 1 99 1 0 3 1 99 1 -1 3 1 99 0 -1 3 1 99 -1 -1 3 1 99 -1 0 3 1 99 -1 1 3 0 1 1 0 1 3 1 1 1 1 3 1 1 1 0 3 1 1 1 -1 3 1 1 0 -1 3 1 1 -1 -1 3 1 1 -1 0 3 1 1 -1 1 3 0 1 99 0 1 3 1 99 1 0 3 1 99 0 -1 3 1 99 -1 0 3 1 1 1 2 3 1 1 2 1 3 1 1 2 -1 3 1 1 1 -2 3 1 1 -1 -2 3 1 1 -2 -1 3 1 1 -2 1 3 1 1 -1 2 3 0 1 99 0 1 3 1 99 1 1 3 1 99 1 0 3 1 99 1 -1 3 1 99 0 -1 3 1 99 -1 -1 3 1 99 -1 0 3 1 99 -1 1 3 1 1 1 2 3 1 1 2 1 3 1 1 2 -1 3 1 1 1 -2 3 1 1 -1 -2 3 1 1 -2 -1 3 1 1 -2 1 3 1 1 -1 2 3 0 3 99 0 1 1 99 1 1 32771 1 0 1 -1025 3 99 1 1 1 99 1 0 32771 1 1 1 -1025 3 99 1 0 1 99 1 -1 32771 1 1 0 -1025 3 99 1 -1 1 99 0 -1 32771 1 1 -1 -1025 3 99 0 -1 1 99 -1 -1 32771 1 0 -1 -1025 3 99 -1 -1 1 99 -1 0 32771 1 -1 -1 -1025 3 99 -1 0 1 99 -1 1 32771 1 -1 0 -1025 3 99 -1 1 1 99 0 1 32771 1 -1 1 -1025 3 99 0 1 1 99 1 -1 32771 1 0 1 -1025 3 99 1 1 1 99 0 -1 32771 1 1 1 -1025 3 99 1 0 1 99 -1 -1 32771 1 1 0 -1025 3 99 1 -1 1 99 -1 0 32771 1 1 -1 -1025 3 99 0 -1 1 99 -1 1 32771 1 0 -1 -1025 3 99 -1 -1 1 99 0 1 32771 1 -1 -1 -1025 3 99 -1 0 1 99 1 1 32771 1 -1 0 -1025 3 99 -1 1 1 99 1 0 32771 1 -1 1 -1025 3 99 0 1 1 99 -1 -1 32771 1 0 1 -1025 3 99 1 1 1 99 -1 0 32771 1 1 1 -1025 3 99 1 0 1 99 -1 1 32771 1 1 0 -1025 3 99 1 -1 1 99 0 1 32771 1 1 -1 -1025 3 99 0 -1 1 99 1 1 32771 1 0 -1 -1025 3 99 -1 -1 1 99 1 0 32771 1 -1 -1 -1025 3 99 -1 0 1 99 1 -1 32771 1 -1 0 -1025 3 99 -1 1 1 99 0 -1 32771 1 -1 1 -1025 3 99 0 1 1 99 -1 1 32771 1 0 1 -1025 3 99 1 1 1 99 0 1 32771 1 1 1 -1025 3 99 1 0 1 99 1 1 32771 1 1 0 -1025 3 99 1 -1 1 99 1 0 32771 1 1 -1 -1025 3 99 0 -1 1 99 1 -1 32771 1 0 -1 -1025 3 99 -1 -1 1 99 0 -1 32771 1 -1 -1 -1025 3 99 -1 0 1 99 -1 -1 32771 1 -1 0 -1025 3 99 -1 1 1 99 -1 0 32771 1 -1 1 -1025 0 1 1 1 1 3 1 1 1 -1 3 1 1 -1 -1 3 1 1 -1 1 3 2 1 1 1 33 99 1 0 3 2 1 1 -1 33 99 0 -1 3 2 1 -1 -1 33 99 -1 0 3 2 1 -1 1 33 99 0 1 3 2 1 1 1 33 99 0 1 3 2 1 1 -1 33 99 1 0 3 2 1 -1 -1 33 99 0 -1 3 2 1 -1 1 33 99 -1 0 3 0 1 1 0 1 3 1 1 1 0 3 1 1 0 -1 3 1 1 -1 0 3 2 1 0 1 33 99 1 1 3 2 1 1 0 33 99 1 -1 3 2 1 0 -1 33 99 -1 -1 3 2 1 -1 0 33 99 -1 1 3 2 1 0 1 33 99 1 -1 3 2 1 1 0 33 99 -1 -1 3 2 1 0 -1 33 99 -1 1 3 2 1 -1 0 33 99 1 1 3 2 1 0 1 33 99 -1 -1 3 2 1 1 0 33 99 -1 1 3 2 1 0 -1 33 99 1 1 3 2 1 -1 0 33 99 1 -1 3 2 1 0 1 33 99 -1 1 3 2 1 1 0 33 99 1 1 3 2 1 0 -1 33 99 1 -1 3 2 1 -1 0 33 99 -1 -1 3 0 1 1 0 1 3 1 1 1 0 3 1 1 0 -1 3 1 1 -1 0 3 1 1 1 2 3 1 1 2 1 3 1 1 2 -1 3 1 1 1 -2 3 1 1 -1 -2 3 1 1 -2 -1 3 1 1 -2 1 3 1 1 -1 2 3 0 1 1 1 1 3 1 1 1 -1 3 1 1 -1 -1 3 1 1 -1 1 3 1 1 1 2 3 1 1 2 1 3 1 1 2 -1 3 1 1 1 -2 3 1 1 -1 -2 3 1 1 -2 -1 3 1 1 -2 1 3 1 1 -1 2 3 0 1 99 1 1 3 1 99 1 -1 3 1 99 -1 -1 3 1 99 -1 1 3 1 1 1 2 3 1 1 2 1 3 1 1 2 -1 3 1 1 1 -2 3 1 1 -1 -2 3 1 1 -2 -1 3 1 1 -2 1 3 1 1 -1 2 3 0 1 99 1 1 3 1 99 1 -1 3 1 99 -1 -1 3 1 99 -1 1 3 1 1 0 1 3 1 1 1 0 3 1 1 0 -1 3 1 1 -1 0 3 0 1 99 0 1 3 1 99 1 0 3 1 99 0 -1 3 1 99 -1 0 3 1 1 1 1 3 1 1 1 -1 3 1 1 -1 -1 3 1 1 -1 1 3 0) 1 def P cond #0 1 16 2 def p cond #0 32 47 3 def Q cond #0 63 0 4 def q cond #0 63 0 5 def K cond #0 104 0 6 def k cond #0 104 0 7 def M cond #0 145 0 8 def m cond #0 145 0 9 def A cond #0 206 0 10 def a cond #0 206 0 11 def S cond #0 287 0 12 def s cond #0 287 0 13 def G cond #0 704 0 14 def g cond #0 704 0 15 def D cond #0 797 0 16 def d cond #0 797 0 17 def N cond #0 962 0 18 def n cond #0 962 0 19 def H cond #0 1023 0 20 def h cond #0 1023 0 21 def C cond #0 1084 0 22 def c cond #0 1084 0 23 def B cond #0 1145 0 24 def b cond #0 1145 0 25 def R cond #0 1186 0 26 def r cond #0 1186 0 27 set extinction 1 28 set promotables (P p) 29 set supply (A a) 30 set promotab ( (a) 0 0 0 0 0 0 (A) ) 31 set repdraw 3 32 set rulemoves 100 33 set resetpieces (P p) 34 set checkrule 1 35 set wroyal (K) 36 set broyal (k) 37 sub postauto1 38 gosub HandleMove false 39 endsub 40 sub postauto2 41 gosub HandleMove true 42 endsub 43 gosub GameEnd true 44 end 45 46 lib /membergraphics/MSplay-test-applet-for-chess-variants/betza.txt 47 if == thismove null 48 say This rule-enforcing preset was created through the Play-Test Applet 49 endif 50 echo Please report any bugs or errors to H.G. Muller 51 setsystem maxmove 4 52 setsystem omitmoves 1 53 ban commands 54 allow pass 2 pass 3 55 set pseudo 0 56 set zonal 0 57 set repeats 3 58 set reploses 0 59 set rulemoves 100 60 set resetpieces (P p) 61 set staledraw 1 62 set checkrule 1 63 set extinction 0 64 set nullban 1 65 set wroyal (K) 66 set broyal (k) 67 set iron array 68 set protected array 69 set counterstrike array 70 set negligible array 71 set brouhaha array 72 set imitators array 73 set inducers array 74 set shooters array 75 set corners 0 76 set method 1 77 set dropdown 1 78 set crappy 0 79 set cap array 80 set tempiron array 81 set epsqrs 0 82 set strike 0 83 set traded 0 84 set nopvc 0 85 set toimitate p 86 set lastfen 0 87 set epmask 4 88 set many ep 0 suicide 0 freedrop 0 89 set hist . "zzz," fencode 90 def friends cond #0 (onlylower) (onlyupper) 91 sub Promote player piece desti 92 my choice r 93 verify mln 94 set r rank #desti 95 if match #piece #promotables 96 set choice elem #r #promotab 97 if #choice 98 set cap mergeall #cap #supply 99 set choice intersection #cap #choice 100 endif 101 else 102 set choice 0 103 endif 104 if #promo 105 if not #choice 106 die "You cannot promote on this move" 107 elseif not match #promo #choice 108 die "You cannot promote to such a piece" 109 endif 110 elseif #choice and not $answered 111 askpromote #choice 112 endif 113 endsub 114 sub GotMove orisqr destsqr locustsqr dropsqr unload implied 115 switch #task 116 case 1 117 set halfhit or #halfhit and #crappy and == #orisqr #ori == #locustsqr #desti 118 verify == #orisqr #ori and == #destsqr #desti 119 if #zonal 120 verify not fn BadZone #orisqr #destsqr #locustsqr #dropsqr #unload 121 endif 122 if != 1 #implied 123 if #firstpart 124 set pseudohit + #pseudohit #crappy 125 set autolocust #locustsqr 126 set autodrop #dropsqr 127 set dropped #unload 128 endif 129 if #sideeffect 130 verify == #sideeffect #dropsqr or == #sideeffect #locustsqr 131 set suicide #locustsqr 132 set freedrop #dropsqr 133 set dropped #unload 134 else 135 verify == #locustsqr #suicide 136 verify == #dropsqr #freedrop 137 verify == #unload #dropped or not #dropsqr 138 endif 139 else 140 verify not #suicide and not #freedrop 141 if #locustsqr 142 capture #locustsqr 143 set imp 1 144 endif 145 set implieddrop #dropsqr 146 set dropped #unload 147 endif 148 set epsqrs #eps 149 set ep #destsqr 150 set ok 1 151 break 152 case 2 153 if #zonal 154 verify not fn BadZone #orisqr #destsqr #locustsqr #dropsqr #unload 155 endif 156 if #locustsqr or #dropsqr and #dropdown and not #implied 157 set m . space #orisqr . ws . #orisqr . chr 45 . #destsqr . chr 59 ws 158 if #locustsqr 159 set m . #m . "@-" #locustsqr 160 elseif #dropsqr 161 set m . #m . #unload . chr 45 #dropsqr 162 endif 163 push xtl #m 164 else 165 setlegal #orisqr #destsqr 166 endif 167 break 168 case 9 169 break 170 case 10 171 case 7 172 case 3 173 set hit cond match space #destsqr #royal space #destsqr #hit 174 if != Xdummy space #locustsqr and #locustsqr 175 set hit cond match space #locustsqr #royal Ughh #hit 176 endif 177 break 178 case 12 179 verify count var #orisqr 180 case 11 181 if & 1 elem 0 var #destsqr and == #orisqr #kpos 182 break 183 endif 184 case 4 185 case 8 186 if #zonal 187 verify not fn BadZone #orisqr #destsqr #locustsqr #dropsqr #unload 188 endif 189 my victim locustvictim 190 set victim space #destsqr 191 set locustvictim space #locustsqr 192 if #locustsqr 193 empty #locustsqr 194 endif 195 move #orisqr #destsqr 196 if #dropsqr 197 add #unload #dropsqr 198 endif 199 dec task 200 set hit 0 201 if == 10 #task 202 if #checked 203 gosub GenAttacks checks 204 endif 205 gosub GenAttacks #orisqr 206 gosub GenAttacks #destsqr 207 if #locustsqr 208 gosub GenAttacks #locustsqr 209 endif 210 if #dropsqr 211 gosub GenAttacks #dropsqr 212 endif 213 else 214 gosub GenAll #xside 215 endif 216 inc task 217 move #destsqr #orisqr 218 if != #dropsqr #orisqr and #dropsqr 219 empty #dropsqr 220 endif 221 if #locustsqr 222 add #locustvictim #locustsqr 223 endif 224 add #victim #destsqr 225 if == 4 #task 226 set hit not #hit 227 elseif #hit 228 set hit 0 229 elseif #locustsqr or #dropsqr and #dropdown and not #implied 230 set m . space #orisqr . ws . #orisqr . chr 45 . #destsqr . chr 59 ws 231 if #locustsqr 232 if match #mover #shooters 233 set m . #m . "@-" #locustsqr 234 else 235 set m . space #orisqr . ws . #orisqr . chr 45 . #locustsqr . chr 59 ws 236 set m . #m . space #orisqr . ws . #locustsqr . chr 45 #destsqr 237 endif 238 elseif #dropsqr 239 set m . #m . #unload . chr 45 #dropsqr 240 endif 241 push xtl #m 242 else 243 setlegal #orisqr #destsqr 244 endif 245 break 246 case 5 247 verify == #locustsqr #desti 248 setlegal #locustsqr #destsqr 249 break 250 case 6 251 verify == #ori #orisqr and == #desti #destsqr 252 if #dropsqr 253 setlegal #desti #dropsqr 254 elseif #locustsqr 255 setlegal #desti #locustsqr 256 endif 257 break 258 case 13 259 verify not #dropsqr and #locustsqr or not empty #destsqr 260 set hit 1 261 break 262 endswitch 263 endsub 264 sub NextLeg togo legindex startsqr cursqr locustsqr dropsqr iso 265 my range dx dy mode to tosqrs k len newindex hx hy side r fratricide stopper 266 set rng elem #legindex #legdefs 267 set dx elem + 1 #legindex #legdefs 268 set dy elem + 2 #legindex #legdefs 269 set mode elem + 3 #legindex #legdefs 270 verify not flag #startsqr or not & 64 #mode 271 if > 0 #rng 272 switch #rng 273 case -1 274 set rng cond < 0 #dy rank #cursqr - lastrank rank #cursqr 275 set rng - >> lastrank 1 #rng 276 set rng max 1 #rng 277 set eps array 278 set mode | << 1 23 #mode 279 break 280 case -2 281 gosub GenMoves #toimitate #startsqr 1 282 return 283 case -3 284 gosub #mode #startsqr #dx #dy 285 return 286 endswitch 287 endif 288 set tosqrs ride #cursqr #dx #dy 289 set r count #tosqrs 290 verify #r 291 set r min #rng #r 292 if & 128 #mode 293 set hx >> + 8 * 5 #dx 4 294 set hy >> + 8 * 5 #dy 4 295 set k ride #startsqr #hx #hy 296 set len count #k 297 set len * #len + abs #hx abs #hy 298 set len / #len + abs #dx abs #dy 299 if < #len #r 300 set r #len 301 if == 9 #task 302 pop k to 303 push #to #ss 304 push #to #mv 305 endif 306 endif 307 verify #len 308 if & << 1 14 #mode 309 set eps array 310 set to where #cursqr #dx #dy 311 set k #cursqr 312 do while != #to #k and onboard #k 313 set k where #k #hx #hy 314 push eps #k 315 loop 316 endif 317 endif 318 dec togo 319 if & << 1 21 #mode 320 set dropsqr #cursqr 321 endif 322 if & << 1 15 #mode 323 verify >= #r #iso 324 set r #iso 325 elseif < 1 #r 326 if & 1 #mode 327 set k 1 328 do while < #k #r and not #hit 329 set to elem dec #k #tosqrs 330 if #togo 331 set newindex + 4 #legindex 332 gosub NextLeg #togo #newindex #startsqr #to #locustsqr #dropsqr #k 333 else 334 gosub GotMove #startsqr #to #locustsqr #dropsqr 0 0 335 endif 336 if & << 1 23 #mode 337 push eps #to 338 endif 339 inc k 340 loop 341 endif 342 if & #epmask #mode 343 set k 1 344 do while < #k #r 345 set to elem dec #k #tosqrs 346 if match #to #epsqrs 347 if #togo 348 set newindex + 4 #legindex 349 gosub NextLeg #togo #newindex #startsqr #to #ep #dropsqr #k 350 else 351 gosub GotMove #startsqr #to #ep #dropsqr 0 1 352 endif 353 endif 354 inc k 355 loop 356 endif 357 if & 18 #mode and == 9 #task 358 set k 1 359 do while < #k #r 360 set to elem dec #k #tosqrs 361 if #togo 362 push #to #ss 363 push #to #mv 364 else 365 setelem #to 0 | 1 elem 0 var #to 366 endif 367 if & 2 #mode and == #to #kpos 368 push checks #ss 369 push checks #mv 370 endif 371 inc k 372 loop 373 endif 374 endif 375 set len cond == 1 #rng #iso #r 376 set to elem dec #r #tosqrs 377 if == 9 #task 378 if cond empty #to (& 18 #mode and #togo) (not & << 1 15 #mode and != #r #rng and or & 2 #mode #togo or and & 1 #mode #togo) 379 push #to #ss 380 push #to #mv 381 endif 382 if & + 2 << 1 13 #mode and == #to #kpos 383 push checks #ss 384 push checks #mv 385 endif 386 if & 2 #mode and not #togo 387 setelem #to 0 | 1 elem 0 var #to 388 endif 389 endif 390 if match #to #epsqrs and & #epmask #mode 391 if #togo 392 set newindex + 4 #legindex 393 gosub NextLeg #togo #newindex #startsqr #to #ep #dropsqr #len 394 else 395 gosub GotMove #startsqr #to #ep 0 0 1 396 endif 397 endif 398 set stopper cond != #to #startsqr space #to @ 399 if == @ #stopper 400 verify & 1 #mode 401 elseif > #musthop 0 402 verify #togo 403 set musthop - #musthop 4 404 set newindex + 4 #legindex 405 gosub NextLeg #togo #newindex #startsqr #to #locustsqr #dropsqr #len 406 return 407 else 408 if & 16 #mode 409 set newindex + 4 #legindex 410 gosub NextLeg #togo #newindex #startsqr #to #locustsqr #dropsqr #len 411 endif 412 set side islower space #startsqr 413 set fratricide cond #side islower #stopper isupper #stopper 414 if #fratricide 415 if & 8 #mode 416 if #corners 417 my xto 418 set xto & << 1 25 #mode 419 set xto cond #xto where #to #dx #dy #to 420 verify match #xto #corners 421 else 422 verify match #to #partners 423 endif 424 verify not flag #to 425 set locustsqr #to 426 set to where #startsqr elem + 5 #legindex #legdefs 0 427 set dropsqr where #to - 0 #dx #dy 428 set eps array 429 set k #startsqr 430 do while != #k #to 431 push eps #k 432 set k where #k #dx 0 433 loop 434 gosub GotMove #startsqr #to #locustsqr #dropsqr #stopper 1 435 return 436 elseif & 2048 #mode 437 if #togo 438 set newindex + 4 #legindex 439 gosub NextLeg #togo #newindex #to #to 0 0 #len 440 elseif != #stopper space #startsqr 441 gosub GenMoves #stopper #startsqr 1 442 endif 443 endif 444 verify & 4096 #mode 445 else 446 verify match #stopper #royal and & << 1 13 #mode or & 2 #mode 447 verify not match #stopper #tempiron 448 endif 449 if #togo and not & << 1 20 #mode 450 set locustsqr #to 451 endif 452 endif 453 if #togo 454 if & << 1 20 #mode 455 if <= #musthop 0 456 gosub GotMove #startsqr #to #locustsqr #dropsqr #stopper 0 457 verify == @ #stopper 458 verify + 1 #musthop 459 endif 460 endif 461 set newindex + 4 #legindex 462 gosub NextLeg #togo #newindex #startsqr #to #locustsqr #dropsqr #len 463 else 464 gosub GotMove #startsqr #to #locustsqr #dropsqr #stopper 0 465 endif 466 endsub 467 sub GenMoves piece sqr all 468 my index legcount startindex hop2 469 set side islower #piece 470 set index fn #piece #all 471 set ss #sqr 472 set hop2 #musthop 473 do 474 set legcount elem #index #legdefs 475 verify #legcount 476 set mv #index 477 inc index 478 set eps 0 479 set musthop & 3 >> elem + 3 #index #legdefs 18 480 gosub NextLeg #legcount #index #sqr #sqr 0 0 0 481 set index + #index * 4 #legcount 482 loop until #hit 483 set musthop #hop2 484 endsub 485 sub GenAttacks sqr 486 my k n togo leg piece hop2 487 set k 1 488 set n count var #sqr 489 set hop2 #musthop 490 do while < #k #n 491 set start elem #k var #sqr 492 inc k 493 set leg elem #k var #sqr 494 inc k 495 set piece space #start 496 if not cond #xside (islower #piece) (isupper #piece) 497 continue 498 endif 499 set togo elem #leg #legdefs 500 inc leg 501 set musthop & 3 >> elem + 3 #index #legdefs 18 502 gosub NextLeg #togo #leg #start #start 0 0 0 503 loop 504 set musthop #hop2 505 endsub 506 sub GenAll player 507 my from piece 508 set hit false 509 for (from piece) fn friends #player 510 gosub GenMoves #piece #from 1 511 verify not #hit 512 next 513 endsub 514 sub GetRoyals player 515 my i nr type 516 set royal cond #player (#broyal) (#wroyal) 517 set many i 0 nr 0 hit 0 518 do while < #i count #royal 519 set type elem #i #royal 520 set nr + #nr elem #type piececount 521 inc i 522 loop 523 set dead count #royal and not #nr 524 if < 1 #nr and #extinction 525 set royal array 526 endif 527 endsub 528 sub InCheck player 529 GetRoyals #player 530 set task 3 531 verify count #royal 532 if #traded 533 add Xdummy #desti 534 push royal Xdummy 535 endif 536 if count #epsqrs and match space #ep #royal 537 set epmask 6 538 endif 539 set player not #player 540 gosub GenAll #player 541 set epmask 4 542 if #traded 543 add #traded #desti 544 endif 545 endsub 546 sub ParseMove player 547 my i j parts sqrs sqr 548 set many suicide 0 freedrop 0 promo 0 sideeffect 0 549 set mvs explode chr 59 thismove 550 set parts explode ws trim elem 0 #mvs 551 set i count #parts 552 if > #i 2 553 die "move must be piece ID plus board step" 554 endif 555 set sqrs explode chr 45 trim elem dec #i #parts 556 if != 2 count #sqrs 557 if == resign thismove 558 resign 559 elseif == drawn thismove 560 drawn 561 endif 562 die "board step does not mention two squares" 563 endif 564 set ori elem 0 #sqrs 565 set desti elem 1 #sqrs 566 if not onboard #desti 567 set msg join #desti " is not a valid square" 568 die #msg 569 endif 570 if not onboard #ori 571 set msg join #ori " is not a valid square" 572 die #msg 573 endif 574 set mover space #ori 575 if not cond #player islower #mover isupper #mover 576 set msg cond == @ #mover (. #ori " is empty") ("you cannot move opponent pieces") 577 die #msg 578 endif 579 set firstpart 1 580 set j 1 581 do while < #j count #mvs 582 set parts trim elem #j #mvs 583 if == "pass" #parts 584 set firstpart 0 585 inc j 586 continue 587 endif 588 set parts explode ws trim #parts 589 set i dec count #parts 590 set sqrs explode chr 45 trim elem #i #parts 591 if != 2 count #sqrs 592 set msg join elem #i #parts " is malformed" 593 die #msg 594 endif 595 set sqr elem 1 #sqrs 596 set sqr cond == "dest" #sqr #desti #sqr 597 if not onboard #sqr 598 set msg join #sqr " is not a valid square" 599 die #msg 600 elseif onboard elem 0 #sqrs 601 if != #desti elem 0 #sqrs 602 die "you can only continue with same piece" 603 endif 604 set firstpart 0 605 if match #mover #shooters 606 set sideeffect #sqr 607 return 608 endif 609 if #suicide 610 die "cannot have more than one locust victim" 611 endif 612 set suicide #desti 613 set desti #sqr 614 elseif == #desti #sqr 615 set promo elem 0 #sqrs 616 elseif == @ elem 0 #sqrs 617 if empty #sqr 618 set msg . "there is nothing on " . #sqr " to capture" 619 die #msg 620 endif 621 if #suicide 622 die "cannot have more than one locust victim" 623 endif 624 set suicide #sqr 625 set firstpart 0 626 else 627 if #freedrop 628 die "cannot kick more than one piece" 629 endif 630 set dropped elem 0 #sqrs 631 set freedrop #sqr 632 set firstpart 0 633 endif 634 inc j 635 loop 636 endsub 637 sub HandleMove player 638 set stm #player 639 gosub ParseMove #player 640 set all == mln $maxmln 641 set many ok 0 hit 0 task 1 halfhit 0 implieddrop 0 imp 0 642 set pseudohit 0 643 gosub GenMoves #mover #ori #all 644 if not match #mover #shooters and #firstpart and #halfhit 645 set ok 2 646 set task 5 647 gosub GenMoves #mover #ori 1 648 set msg . "Enter second leg or pass" 649 remind #msg 650 elseif #all 651 set cap unique keys capturedpieces 652 set lastfen fencode 653 if not #ok 654 set pseudohit 0 655 gosub GenAll #player 656 endif 657 if #sideeffect 658 rewritemove . elem 0 #mvs . "; " . cond #freedrop #dropped @ . chr 45 #sideeffect 659 set sideeffect 0 660 gosub ParseMove #player 661 endif 662 if match #mover #shooters and < 1 #pseudohit 663 set ok 2 664 set task 6 665 gosub GenAll #player 666 if #hit 667 set msg . "Type side effect of move, or pass" 668 else 669 set msg . "Type side effect of move" 670 endif 671 remind #msg 672 elseif not #ok 673 if == 1 #pseudohit 674 if #autolocust 675 appendmove join "@-" #autolocust 676 endif 677 if #autodrop 678 appendmove join #dropped join chr 45 #autodrop 679 endif 680 gosub ParseMove #player 681 elseif #pseudohit 682 set msg . "Type side effects of move" 683 remind #msg 684 continuemove 685 return 686 else 687 set msg . thismove . " is not even pseudo-legal for a " toupper #mover 688 die #msg 689 endif 690 endif 691 endif 692 set victim cond != #desti #ori space #desti @ 693 set traded cond and or match space #suicide #negligible not #suicide and match #victim #protected match #mover #protected #mover 0 694 set strike and match #victim #counterstrike not match #mover #counterstrike 695 set k 0 696 do while < var k count var mvs 697 eval join "MOVE: " trim elem var k var mvs 698 inc k 699 loop 700 if != #ori #freedrop and match #ori #brouhaha 701 delete #ori 702 endif 703 if #implieddrop 704 add #dropped #implieddrop 705 endif 706 set tempiron #iron 707 if #strike 708 set tempiron mergeall #tempiron #counterstrike 709 endif 710 set toimitate flipcase cond match #mover #imitators #toimitate #mover 711 setflag #desti 712 set posvar join cond #player "w" "b" fencode 713 inc #posvar 714 inc nopvc 715 if #imp 716 set hist . #hist . "," mln 717 endif 718 if #suicide and not #freedrop or #promo or != @ #victim or match #mover #resetpieces 719 set nopvc 0 720 endif 721 endsub 722 sub GameEnd player 723 my side 724 if == 2 #ok 725 continuemove 726 return 727 endif 728 set side not #player 729 gosub GetRoyals #side 730 if #dead 731 set msg join cond #player "White" "Black" " lost by absence of royalty!" 732 say #msg 733 won 734 elseif == #lastfen fencode and #nullban 735 die "This is a null move!" 736 endif 737 gosub InCheck #player 738 if == #hit Xdummy 739 die "Trading of this piece is not allowed" 740 elseif #checkrule and #hit 741 if == #hit Ughh 742 die "That moves through or out of check" 743 else 744 die "This exposes your royal piece to capture" 745 endif 746 endif 747 if >= 1 count fn friends #player and #baring 748 if >= 1 count fn friends #side 749 say Draw by mutual baring 750 drawn 751 else 752 set msg . cond #player "Black" "White" " loses by baring" 753 say #msg 754 lost 755 endif 756 return 757 endif 758 gosub Promote #player #mover #desti 759 gosub GetRoyals #side 760 if count #royal and #checkrule 761 set task 4 762 set xside #player 763 gosub GenAll #side 764 if not #hit 765 if #staledraw 766 dec task 767 gosub GenAll #player 768 if #hit 769 say Checkmate! 770 won 771 else 772 say Stalemate! 773 drawn 774 endif 775 else 776 say Mate! 777 won 778 endif 779 return 780 endif 781 endif 782 set posvar join cond #player "w" "b" fencode 783 if >= var #posvar #repeats 784 if #reploses 785 set msg join cond #player "Black" "White" " loses by repetition!" 786 say #msg 787 lost 788 else 789 say "Draw by repetition!" 790 drawn 791 endif 792 elseif >= #nopvc #rulemoves 793 say "Game declared draw due to prolongued lack of progress!" 794 drawn 795 endif 796 set ltst count #royal and not #pseudo 797 set xtl array 798 if == 1 #method and #ltst 799 for sqr spaces 800 set #sqr array 0 801 next 802 set task 9 803 set king elem 0 #royal 804 set kpos search #king $space 805 empty #kpos 806 set checks array 0 807 gosub GenAll #player 808 add #king #kpos 809 set checked & 1 elem 0 var #kpos 810 if #checked 811 say "check!" 812 endif 813 set task 11 814 gosub GenAll #side 815 else 816 set task cond #ltst 8 2 817 gosub GenAll #side 818 endif 819 setjsvar impmoves #hist 820 setsystem legalmoves merge $legalmoves #xtl 821 endsub 822 set posvar join "w" fencode 823 inc #posvar 824 endlibfunctions
Array ( [friends] => Array ( [0] => cond [1] => #0 [2] => Array ( [0] => onlylower ) [3] => Array ( [0] => onlyupper ) ) [P] => Array ( [0] => cond [1] => #0 [2] => 1 [3] => 16 ) [p] => Array ( [0] => cond [1] => #0 [2] => 32 [3] => 47 ) [Q] => Array ( [0] => cond [1] => #0 [2] => 63 [3] => 0 ) [q] => Array ( [0] => cond [1] => #0 [2] => 63 [3] => 0 ) [K] => Array ( [0] => cond [1] => #0 [2] => 104 [3] => 0 ) [k] => Array ( [0] => cond [1] => #0 [2] => 104 [3] => 0 ) [M] => Array ( [0] => cond [1] => #0 [2] => 145 [3] => 0 ) [m] => Array ( [0] => cond [1] => #0 [2] => 145 [3] => 0 ) [A] => Array ( [0] => cond [1] => #0 [2] => 206 [3] => 0 ) [a] => Array ( [0] => cond [1] => #0 [2] => 206 [3] => 0 ) [S] => Array ( [0] => cond [1] => #0 [2] => 287 [3] => 0 ) [s] => Array ( [0] => cond [1] => #0 [2] => 287 [3] => 0 ) [G] => Array ( [0] => cond [1] => #0 [2] => 704 [3] => 0 ) [g] => Array ( [0] => cond [1] => #0 [2] => 704 [3] => 0 ) [D] => Array ( [0] => cond [1] => #0 [2] => 797 [3] => 0 ) [d] => Array ( [0] => cond [1] => #0 [2] => 797 [3] => 0 ) [N] => Array ( [0] => cond [1] => #0 [2] => 962 [3] => 0 ) [n] => Array ( [0] => cond [1] => #0 [2] => 962 [3] => 0 ) [H] => Array ( [0] => cond [1] => #0 [2] => 1023 [3] => 0 ) [h] => Array ( [0] => cond [1] => #0 [2] => 1023 [3] => 0 ) [C] => Array ( [0] => cond [1] => #0 [2] => 1084 [3] => 0 ) [c] => Array ( [0] => cond [1] => #0 [2] => 1084 [3] => 0 ) [B] => Array ( [0] => cond [1] => #0 [2] => 1145 [3] => 0 ) [b] => Array ( [0] => cond [1] => #0 [2] => 1145 [3] => 0 ) [R] => Array ( [0] => cond [1] => #0 [2] => 1186 [3] => 0 ) [r] => Array ( [0] => cond [1] => #0 [2] => 1186 [3] => 0 ) )uservar
Array ( [0] => Array ( [main] => Array ( [pseudo] => 0 [zonal] => 0 [repeats] => 3 [reploses] => 0 [rulemoves] => 100 [resetpieces] => Array ( [0] => P [1] => p ) [staledraw] => 1 [checkrule] => 1 [extinction] => 1 [nullban] => 1 [wroyal] => Array ( [0] => K ) [broyal] => Array ( [0] => k ) [iron] => Array ( ) [protected] => Array ( ) [counterstrike] => Array ( ) [negligible] => Array ( ) [brouhaha] => Array ( ) [imitators] => Array ( ) [inducers] => Array ( ) [shooters] => Array ( ) [corners] => 0 [method] => 1 [dropdown] => 1 [crappy] => 0 [cap] => Array ( ) [tempiron] => Array ( ) [epsqrs] => 0 [strike] => 0 [traded] => 0 [nopvc] => 0 [toimitate] => p [lastfen] => 0 [epmask] => 4 [ep] => 0 [suicide] => 0 [freedrop] => 0 [hist] => zzz,brnadskmqhgcpppppppppppp48PPPPPPPPPPPPRDMSHQKGNABC [posvar] => wbrnadskmqhgcpppppppppppp48PPPPPPPPPPPPRDMSHQKGNABC [wbrnadskmqhgcpppppppppppp48PPPPPPPPPPPPRDMSHQKGNABC] => 1 [promotables] => Array ( [0] => P [1] => p ) [supply] => Array ( [0] => A [1] => a ) [promotab] => Array ( [0] => Array ( [0] => a ) [1] => 0 [2] => 0 [3] => 0 [4] => 0 [5] => 0 [6] => 0 [7] => Array ( [0] => A ) ) [repdraw] => 3 [royal] => Array ( [0] => k ) [hit] => [dead] => [RESULT] => [task] => 3 [side] => [ss] => a2 [mv] => 1 [eps] => 0 [musthop] => 0 [rng] => ) ) [1] => Array ( [GameEnd] => Array ( [subargs] => Array ( [0] => true ) [side] => ) [main] => Array ( [player] => true ) ) [2] => Array ( [InCheck] => Array ( [subargs] => Array ( [0] => true ) ) [main] => Array ( [player] => ) ) [3] => Array ( [GenAll] => Array ( [subargs] => Array ( [0] => ) [from] => a2 [piece] => P ) [main] => Array ( [player] => ) ) [5] => Array ( [GenMoves] => Array ( [subargs] => Array ( [0] => P [1] => a2 [2] => 1 ) [index] => 2 [legcount] => [startindex] => 0 [hop2] => #musthop ) [main] => Array ( [piece] => P [sqr] => a2 [all] => 1 ) ) [7] => Array ( [NextLeg] => Array ( [subargs] => Array ( [0] => #legcount [1] => 2 [2] => a2 [3] => a2 [4] => 0 [5] => 0 [6] => 0 ) [range] => 0 [dx] => [dy] => [mode] => [to] => 0 [tosqrs] => 0 [k] => 0 [len] => 0 [newindex] => 0 [hx] => 0 [hy] => 0 [side] => 0 [r] => 0 [fratricide] => 0 [stopper] => 0 ) [main] => Array ( [togo] => #legcount [legindex] => 2 [startsqr] => a2 [cursqr] => a2 [locustsqr] => 0 [dropsqr] => 0 [iso] => 0 ) ) )mline
Array ( [0] => MoveLine Object ( [movenum] => 0 [move] => [level] => 0 [comment] => [length] => 0 [newturn] => [turn] => 0 ) )allmoves
Array ( )movelist
constants
Array ( )