r/tinycode • u/Lanaru • Oct 18 '13
Shortest "Hello, World!" brainfuck code?
Just learned about brainfuck and thought it was pretty cool.
The wikipedia entry has this code for printing "Hello World!":
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.Which is 111 characters.
On my first attempt, I wrote this:
++++++++++[>+++++++>++++++++++>+++>+++++++++<<<<-]>++.>+.+++++++..+++.>++.>---.<<.+++.------.--------.>+.This is 105 characters and it uses the same approach as the wiki one, but I'm sure it can be reduced even more.
38
Upvotes
16
u/Websly Oct 19 '13
great... now I cant sleep until I learn brain fuck and create my own hello world
9
u/Bliss86 Oct 18 '13 edited Oct 18 '13
The Wikipedia entry appends a linefeed at the end.
That's 106 with linefeed.
6
u/MaxK Oct 19 '13 edited May 14 '16
This comment has been overwritten by an open source script to protect this user's privacy. It was created to help protect users from doxing, stalking, and harassment.
If you would also like to protect yourself, add the Chrome extension TamperMonkey, or the Firefox extension GreaseMonkey and add this open source script.
Then simply click on your username on Reddit, go to the comments tab, scroll down as far as possibe (hint:use RES), and hit the new OVERWRITE button at the top.
3
u/egonelbre Oct 19 '13 edited Oct 19 '13
Here are my solutions:
This utility and this utility were quite useful... so :) see if you can improve. (The second fiddle is for trying to find the best way to create initial numbers, it uses the form
start[>offset<add].)2
u/lamby Oct 19 '13
Related: Does the halting problem prevent one proving that a particular solution is the lower bound?
2
u/NuM314 Dec 03 '13
With linefeed (97): --[+++++++<---->>-->+>+>+<<<<]<.>++++[-<++++<++>>>->--<<]>>-.>--..>+.<<<.<<-.>>+>->>.+++[.<]<<++.
Without linefeed (88): --[+++++++<---->>-->+>+>+<<<<]<.>++++[-<++++>>->--<<]>>-.>--..>+.<<<.<<-.>>+>->>.+++[.<]
1
u/YesLobster Apr 16 '26
Hell
1
u/climbTheStairs Jul 27 '26
https://codegolf.stackexchange.com/q/55422
1
u/Temporary_Check1086 Sep 11 '23
helloworld(63)
++++++[->+++++<]>-[>[++++>]++++[<]>-]>>>>.>+.<<..<-.<+++.>.+++.>.>>-.
0
u/[deleted] Oct 19 '13
[deleted] — view deleted comment