3 ms·
Well I just posted a link to my little subleq article in another thread the other day but in case someone didn't see it: https://portal.mozz.us/gemini/biomimet
by ilaksh 6y ago
Well I just posted a link to my little subleq article in another thread the other day but in case someone didn't see it:
https://portal.mozz.us/gemini/biomimetic.me/subleq.gmi https://portal.mozz.us/gemini/biomimetic.me/subleq.gmi
On that page I have a little subleq program written using HSQ (High-Level Subleq, a C-like language that compiles subleq) that uses ANSI graphics for a simple D&D dice roller.
One thing I think that should be a little different than what is on Rosetta Code for example is to make sure that the STDIN input does not require an ENTER key or something like that. Because that allows for more interactive programs rather than line-based.
Here is my little C subleq interpreter that does it that way: https://github.com/runvnc/sq/blob/master/sq.c https://github.com/runvnc/sq/blob/master/sq.c .. and it also flushes STDOUT quickly if I recall. Mine is based on this one: https://github.com/davidar/subleq/blob/master/src/sq.c https://github.com/davidar/subleq/blob/master/src/sq.c
Maybe using ANSI escape codes is cheating. But if you don't mind cheating, just having the STDOUT allows you to also do vector graphics, if your terminal happens to support that. Such as an xterm which can do vector graphics (draw lines) using Tektronix 4010/4014 escape codes.