3 ms·
I'm pretty happy with "json scripting" for an implementation[0] of card game[1] with relatively low rules complexity. For a time it could evaluate arithmetic ex
by anonymoushn 2y ago
I'm pretty happy with "json scripting" for an implementation[0] of card game[1] with relatively low rules complexity. For a time it could evaluate arithmetic expressions, but I got rid of that because it was a bit unwieldy. The main pain point is that it runs slower than I'd like, so I may end up porting it all to actual Javascript functions or to Zig.
[0]: https://github.com/sharpobject/yisim/blob/master/swogi.json https://github.com/sharpobject/yisim/blob/master/swogi.json
[1]: https://store.steampowered.com/app/1948800/Yi_Xian_The_Cultivation_Card_Game/ https://store.steampowered.com/app/1948800/Yi_Xian_The_Culti...
- tombert 2y agoThe first time I did this, I ended up writing stuff that could use replace strings with regular expressions, do arithmetic, string concatenation, and a few other things. It was honestly kind of cool but it was horrible to maintain and I wish I had just kept the JSON as data.