Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kriskowal
Last active December 12, 2018 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kriskowal/5b6943464624b8412c5dab009dbd7c02 to your computer and use it in GitHub Desktop.
Save kriskowal/5b6943464624b8412c5dab009dbd7c02 to your computer and use it in GitHub Desktop.
I wonder whether I could make this language work.
- TYPE ITEMTYPE:
- A: THREAD
- ONE: THREAD
- MANY: THREAD
- TYPE ITEM:
- TYPE: ITEMTYPE
- COUNT: NUMBER
- ITEMTYPE ARROWTYPE:
- A: an
- ONE: arrow
- MANY: arrows
- ITEMTYPE GOLDTYPE:
- A: a
- ONE: gold
- MANY: gold
- ITEMTYPE HITTYPE:
- A: a
- ONE: hit
- MANY: hits
- ITEM GOLD:
- TYPE: GOLDTYPE
- COUNT: 2
- ITEM ARROW:
- TYPE: ARROWTYPE
- COUNT: 0
- ITEM HITS:
- TYPE: HITTYPE
- COUNT: 0
You enter the fletcher’s shop. The fletcher beckons, “There are arrows
for sale and a range out back you can try your skills and maybe win your
fortune. For each hit, you win more gold!” //
- THREAD SHOP:
You have COUNT(ARROWS) {ARROWS.COUNT?and|{GOLD.COUNT?but|and}} COUNT(GOLD).
+ -GOLD.COUNT +ARROWS.COUNT
[You b[B]uy 3 arrows for a gold piece. ]
+ +GOLD -4ARROWS
[You s[S]ell 4 arrows for a gold piece. ]
+ [You walk through the door to [Visit] the archery range. ]
RANGE
+ [Leave the store. ]
You depart the store through the back door with COUNT(GOLD).
HITS.COUNT?
- All told you scored COUNT(HITS).
END
>
SHOP
- THREAD RANGE:
You have COUNT(ARROWS).
+ -ARROWS
[You s[S]hoot an arrow[.]]
- RANDOM
- 1: and hit the target, winning {HITS.COUNT? another | a } gold piece!
+HITS.COUNT
RANGE
- 4: and miss.
+ [You r[R]eturn to the archery shop. ]
SHOP
>
RANGE
- THREAD COUNT:
{COUNT|no TYPE.MANY|TYPE.A COUNT TYPE.ONE|COUNT TYPE.MANY}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment