IDouble / Brainfuck-Interpreter-Node.js

🛠 This is a Brainfuck interpreter written in JavaScript 🖥
MIT License
14 stars 2 forks source link

Hello World fails. #2

Open rdebath opened 5 years ago

rdebath commented 5 years ago

This program should print "Hello World!" not random control characters.

+[>[<-[]>+[>+++>[+++++++++++>][>]-[<]>-]]++++++++++<]>>>>>>----.<<+++.<-..+++.<-.>>>.<<.+++.------.>-.<<+.<.
IDouble commented 5 years ago

I tested "Hello World!" with both of these Tools and it's working.

https://copy.sh/brainfuck/text.html

-[------->+<]>-.-[->+++++<]>++.+++++++..+++.[--->+<]>-----.---[->+++<]>.-[--->+<]>---.+++.------.--------.-[--->+<]>.

https://www.dcode.fr/brainfuck-language

++++++++++[>+>+++>+++++++>++++++++++<<<<-]>>>++.>+.+++++++..+++.<<++.>+++++++++++++++.>.+++.------.--------.<<+.

Brainfuck Interpreter Hello World

What is the official Charset of Brainfuck? ANSI-8? or UTF-16?

rdebath commented 5 years ago

Yes, well, those "Hello World!" programs just contain simple loops, my one is much more annoying 😁

As I wrote on the Esolangs Wiki it is a little obscure what character set should be used. Occasionally, you get programs that output binaries (for example a BF compiler that outputs Linux ELF executables) but usually the output characters are plain ASCII, so any 8-bit character set works. The few Russians, Chinese and Japanese I've seen seem to use UTF-8. Nobody uses UTF-16. All variations use just a character 10 as the newline character.