TrollScript, an esoteric dialect of Brainfuck.
41–49 of 49 posts
Re: TrollScript, an esoteric dialect of Brainfuck.
#42Get back to me when I can write it in an IDE with syntax highlighting and content assist.
Re: TrollScript, an esoteric dialect of Brainfuck.
#43Earlier quoted context omitted.
beautiful! 12 minutes : >,[[>,]] edit: of course it should be >,[>,]<[.<]
">,[>,] pStr++; *pStr = getc(stdin); //or wherever while *pStr { pStr++; *pStr = getc(stdin); } pStr--; while *pStr { putc (*pStr, stdout) pStr--; } It'll print the reverse of a string, but it will also print everything before it until it hits a null byte. I'd add to the beginning to null out the preceding byte and hope it wasn't important. As silly as brainfuck seems, I could see something like it being used in nano…
exactly! The brainfuck execution starts with the pointer at the first byte of zero-filled array:
http://www.muppetlabs.com/~breadbox/bf/
So the first ">" in my program moves the pointer to the next byte, and this skipped first byte would serve as a stopper when pointer moves back.
Re: TrollScript, an esoteric dialect of Brainfuck.
#44Re: TrollScript, an esoteric dialect of Brainfuck.
#45Re: TrollScript, an esoteric dialect of Brainfuck.
#46I work for a company that primarily uses LOLCODE. I've been trying to convince my boss of the benefits of moving to Trollscript, so I wrote this Trollscript interpreter in LOLCODE: https://github.com/aduros/trollcat
Re: TrollScript, an esoteric dialect of Brainfuck.
#47Something inspired me to write a Brainfuck interpreter after reading this so I just put together one in Scheme with a TrollScript compatibility layer. I haven't tested it extensively but it seems to work with everything that I've thrown at it. https://github.com/Wollw/BrainScript I wrote it using Guile 1.8.7 and I have no idea if I'm using Guile specific features or not. edit: Seems it's still a bit broken. The rever…
Here's one a friend and I did in Prolog last year: https://github.com/danieldk/brainfuck-pl Why? Because it can be done. And actually prolog's tracing mechanism makes debugging brainfuck code quite insightful.
Re: TrollScript, an esoteric dialect of Brainfuck.
#48Earlier quoted context omitted.
">,[>,] pStr++; *pStr = getc(stdin); //or wherever while *pStr { pStr++; *pStr = getc(stdin); } pStr--; while *pStr { putc (*pStr, stdout) pStr--; } It'll print the reverse of a string, but it will also print everything before it until it hits a null byte. I'd add to the beginning to null out the preceding byte and hope it wasn't important. As silly as brainfuck seems, I could see something like it being used in nano…
>It'll print the reverse of a string, but it will also print everything before it until it hits a null byte. exactly! The brainfuck execution starts with the pointer at the first byte of zero-filled array: http://www.muppetlabs.com/~breadbox/bf/ So the first ">" in my program moves the pointer to the next byte, and this skipped first byte would serve as a stopper when pointer moves back.
It's an interesting language, and one that I'm not convinced is so entirely without practical application as is commonly stated.
Re: TrollScript, an esoteric dialect of Brainfuck.
#49A trollscript interpreter in trollscript: https://raw.github.com/gist/1204925/743626cf2313690d82243e99... Have it sung to you on OS X: $(curl https://raw.github.com/gist/1204925/743626cf2313690d82243e99... | say -v "Bad News")