Did anyone notice when you type something wrong screen suddenly changes to white or whatever colors ? What feature is that? Or maybe its not feature at all?
It turns out the [tag attribute=value] syntax is awkward with setting variables like in [var set=x=5].
Maybe I can fix it through creatively naming the tags and attributes. [var x=5] is an option. Maybe [var x] to read it and [var x++] to increment could be possible if I give up on the original syntax idea.
Or maybe I can add an implicit unnamed attribute that collects values that don't have one explicitly set.
It's an option. I'm not sure how writer-friendly that is.
Then again I don't think I actually need to make this syntax pretty. It will rarely come up. Maybe once in a while with You have [money] gold coins., but that's very rare. Most of the time it will be about selecting text based on conditions.
That's a good observation - shoot for center of mass. If the solution handles the majority of the cases w/out making the minority impossible to solve, it's probably good enough.
I also foolishly used regex for parsing. I should have known better.
I wonder if the language will end up turing-complete.
And some nerds port Minecraft to the CYOA engine.
[print x] and [set x=5] are probably good enough. [set x=x+1] should also be enough, x++ isn't needed.
What is needed is some sort of limiter function. `You lift the boulder. [set str=str+1 condition=str<10]` might be a little unwieldy and deserve a shortcut. The variable is mentioned 3 times.
[increase var=x condition=x<10 amount=1]
It looks way longer than it should.
[x<10?++] would be regex-like and we all love regex for being perfectly readable.
I should have paid attention in compiler class. Let's hope my vague idea of a recursive descent parser is good enough.
ANTLR is complicated. I'm not sure if it's less complicated than writing a parser, especially since it involves installing software and generating code which goes away from just opening an HTML file in a browser.
I don't know. It's complicated. Maybe I can afford the hand-written parse for a bit longer and think that the language is simple enough that it's fine.
I'll do the simple tags and provide a [js] and [html] tag for people who want more.
Because I was too stubborn to change my card game design assignment for my students (or pay for/teach them all to use Tabletop Simulator), I'm making an app where they can build their card games online and play them remotely.