Overview
Comment: | Change Four and Eight to Rook and Queen; also add Bishop |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
e3c2fc3bcb7920cc0124a95619397dee |
User & Date: | user on 2021-05-20 00:47:05 |
Other Links: | manifest | tags |
Context
2021-05-22
| ||
23:10 | Fix documentation of CLASS_DATA function check-in: ad65a30a4b user: user tags: trunk | |
2021-05-20
| ||
00:47 | Change Four and Eight to Rook and Queen; also add Bishop check-in: e3c2fc3bcb user: user tags: trunk | |
2021-05-18
| ||
06:25 | Always disable buffering for stderr. check-in: 79b85a3d23 user: user tags: trunk | |
Changes
Modified class.c from [390a2adac5] to [674cdbf650].
︙ | |||
1101 1102 1103 1104 1105 1106 1107 | 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 | - - + + + | for(;;) { nxttok(); if(Tokenf(TF_MACRO)) ParseError("Unexpected macro\n"); if(Tokenf(TF_DIR)) { cl->codes[ptr++]=tokenv&15; } else if(Tokenf(TF_NAME)) { switch(tokenv) { |
︙ |
Modified class.doc from [ca75a1769b] to [529040a567].
︙ | |||
2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 | 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 | + + + - - - - - - | is repeated until it no longer matches. If the first word is begin, then it must match at least once; if it is if, then it can match zero or more times. The match is greedy; it will match as much as possible. begin Begin a block. Bishop Try four directions (NE, NW, SW, and SE). Climb Fail the match if the origin object cannot climb here. (Climb <number>) Fail the match if the height here is greater than this number. cut Discards the most recent choice point. else Delimits alternatives within a block. |
︙ | |||
2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 | 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 | + + + + + + | ObjBottomAt Match the object at the bottom of this location. ObjTopAt Match the object at the top of this location. Queen Try all eight directions. Rook Try four directions (E, N, W, and S). then Ends a block started with begin or if. Trace Used for debugging. |
︙ |
Modified exec.c from [d618410326] to [51d82ac75e].
︙ | |||
1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 | 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 | + + + + + + + + + + + + + | cp[cpi].dir=d; cp[cpi].depth=vstackptr; ptr=code[ptr]+2; break; case OP_BEGIN: ptr++; break; case OP_BISHOP: if(cpi>=MAXCHOICE-4) Throw("Choice overflow"); d=1; cpi+=3; cp[cpi].x=x; cp[cpi].y=y; cp[cpi].depth=vstackptr; cp[cpi].ptr=ptr; cp[cpi-1]=cp[cpi-2]=cp[cpi]; cp[cpi].dir=3; cp[cpi-1].dir=5; cp[cpi-2].dir=7; break; case OP_CLIMB: if(playfield[x+y*64-65]==VOIDLINK || height_at(x,y)>objects[obj]->climb) goto fail; break; case OP_CLIMB_C: g=code[ptr++]; if(playfield[x+y*64-65]==VOIDLINK || height_at(x,y)>g) goto fail; break; |
︙ | |||
1746 1747 1748 1749 1750 1751 1752 | 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | objects[obj]->dir=d; break; case OP_DIR_EC: if(n==VOIDLINK) Throw("No object specified in pattern"); changed=1; objects[n]->dir=d; break; |
︙ | |||
1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 | 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | break; case OP_OBJBOTTOMAT: n=obj_bottom_at(x,y); break; case OP_OBJTOPAT: n=obj_top_at(x,y); break; case OP_QUEEN: if(cpi>=MAXCHOICE-8) Throw("Choice overflow"); d=0; cpi+=7; cp[cpi].x=x; cp[cpi].y=y; cp[cpi].depth=vstackptr; cp[cpi].ptr=ptr; cp[cpi-1]=cp[cpi-2]=cp[cpi-3]=cp[cpi-4]=cp[cpi-5]=cp[cpi-6]=cp[cpi]; cp[cpi].dir=1; cp[cpi-1].dir=2; cp[cpi-2].dir=3; cp[cpi-3].dir=4; cp[cpi-4].dir=5; cp[cpi-5].dir=6; cp[cpi-6].dir=7; break; case OP_RET: if(all) { if(vstackptr>=VSTACKSIZE-1) Throw("Stack overflow"); if(n==VOIDLINK) n=obj_bottom_at(x,y); Push(OVALUE(n)); goto fail; } else { return n==VOIDLINK?obj_bottom_at(x,y):n; } break; case OP_ROOK: if(cpi>=MAXCHOICE-4) Throw("Choice overflow"); d=0; cpi+=3; cp[cpi].x=x; cp[cpi].y=y; cp[cpi].depth=vstackptr; cp[cpi].ptr=ptr; cp[cpi-1]=cp[cpi-2]=cp[cpi]; cp[cpi].dir=2; cp[cpi-1].dir=4; cp[cpi-2].dir=6; break; case OP_SUB: if(vstackptr>=VSTACKSIZE-1) Throw("Stack overflow"); Push(NVALUE(0)); break; case OP_THEN: // This opcode does nothing break; |
︙ |
Modified instruc from [41c1a088a9] to [3f9b18c19d].
︙ | |||
293 294 295 296 297 298 299 | 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | - - + + + | ArraySlice CopyArray DotProduct ; Pattern matching -,=Pattern "P" -,=PatternS "P*" |
︙ |
Modified instruc.h from [0d28c1603f] to [bdce706361].
︙ | |||
425 426 427 428 429 430 431 | 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 | - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + | #define OP_PATTERN_C 35036 #define OP_PATTERN_E 37084 #define OP_PATTERN_EC 39132 #define OP_PATTERNS 32989 #define OP_PATTERNS_C 35037 #define OP_PATTERNS_E 37085 #define OP_PATTERNS_EC 39133 |
︙ | |||
476 477 478 479 480 481 482 483 484 485 486 487 488 489 | 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 | + | {"BOOOM",8389410}, {"BOUNCE",8389415}, {"BRRREEET",8389396}, {"BRRRT",8389395}, {"BUZZER",8389420}, {"BWEEP",8389397}, {"Background",8683650}, {"Bishop",8683743}, {"Broadcast",10518671}, {"BroadcastAnd",8421520}, {"BroadcastAndEx",8421521}, {"BroadcastEx",10518675}, {"BroadcastList",8421524}, {"BroadcastListEx",8421525}, {"BroadcastSum",8421526}, |
︙ | |||
526 527 528 529 530 531 532 | 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 | - - | {"Dir",8618050}, {"Distance",9142342}, {"Done",8618099}, {"DotProduct",8421595}, {"E",9437184}, {"END_TURN",8389139}, {"EditorHelp",8683657}, |
︙ | |||
622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 | 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 | + + | {"P*",8880349}, {"PLAYERMOVING",8389133}, {"POSTINIT",8389138}, {"POUR",8389377}, {"POWER",8389386}, {"Player",8487029}, {"PopUp",8421563}, {"Queen",8683744}, {"Quiz",8683653}, {"R",9437198}, {"RATCHET1",8389418}, {"RATCHET2",8389412}, {"RATTLE",8389403}, {"RB",9437197}, {"RF",9437199}, {"Rel",8487101}, {"Rook",8683742}, {"S",9437190}, {"SE",9437191}, {"SMALL_POP",8389389}, {"SPLASH",8389376}, {"STEAM",8389424}, {"STOP",8388608}, {"SUBS",8683659}, |
︙ | |||
652 653 654 655 656 657 658 | 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 | - + | {"Shape",8618047}, {"ShapeDir",8618070}, {"Sharp",8618069}, {"Shovable",8618071}, {"Sound",8421570}, {"Stealthy",8618096}, {"Strength",9142354}, |
︙ | |||
728 729 730 731 732 733 734 | 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 | - + | {"bor",8421412}, {"bxor",8421413}, {"c?",8421429}, {"case",8683542}, {"chain",8421528}, {"clear",8421586}, {"count",8421585}, |
︙ | |||
777 778 779 780 781 782 783 | 779 780 781 782 783 784 785 786 787 | - + | {"then",8683531}, {"tmark",8421580}, {"tuck",8421380}, {"uniq",8421587}, {"until",8683534}, {"while",8683535}, }; |