I had to do this. I just decided to take my old BF interpreter and give it a little bit of tweaking. It now implements the state-of-the-art GGGGGG (THAT'S 6 Gs!) esoteric language.
An example program in GGGGGG:
The above will take a set of inputs until it finds an empty one and then print the word.
The language itself is essentially a BF derivative. The length of a set of Gs determines the BF character function.
1 Gs ---> >
2 Gs ---> <
3 Gs ---> .
4 Gs ---> +
5 Gs ---> -
6 Gs ---> ,
7 Gs ---> [
8 Gs ---> ]
This of course assumes you understand the elementary BF character instructions. The stack pointer system is entirely the same.
GGGGGG also implements a feature that BF does not: jumps. If your set of Gs is 9 or longer, a jump is performed. The stack pointer will be explicitly set to (length) - 9.
For instance:
will jump to index 0.
will jump to index 3.
etc.
A pastebin of the interpreter can be found here:
http://pastebin.com/9eA5XAVB
This pastebin will link you to a quick program that will change all the BF code in your file to GGGGGG (no, it doesn't optimize for jumps):
http://pastebin.com/RAc4VzpN
Any questions or concerns? Want to suggest a better character/length organization? Leave it as a reply below and I will consider!
An example program in GGGGGG:
Code:
G GGGGGG GGGGGGG G GGGGGG GGGGGGGG GGGGGGGGG GGGGGGG G GGG GGGGGGGG
The above will take a set of inputs until it finds an empty one and then print the word.
The language itself is essentially a BF derivative. The length of a set of Gs determines the BF character function.
1 Gs ---> >
2 Gs ---> <
3 Gs ---> .
4 Gs ---> +
5 Gs ---> -
6 Gs ---> ,
7 Gs ---> [
8 Gs ---> ]
This of course assumes you understand the elementary BF character instructions. The stack pointer system is entirely the same.
GGGGGG also implements a feature that BF does not: jumps. If your set of Gs is 9 or longer, a jump is performed. The stack pointer will be explicitly set to (length) - 9.
For instance:
Code:
GGGGGGGGG (9 Gs)
Code:
GGGGGGGGGGGG (12 Gs)
etc.
A pastebin of the interpreter can be found here:
http://pastebin.com/9eA5XAVB
This pastebin will link you to a quick program that will change all the BF code in your file to GGGGGG (no, it doesn't optimize for jumps):
http://pastebin.com/RAc4VzpN
Any questions or concerns? Want to suggest a better character/length organization? Leave it as a reply below and I will consider!