My first foray into Brainfuck

Print damned.

print "damned"

Obfuscate it.

print 'qnzarq'.decode('rot13')

Now print “damned” in Brainfuck, and let’s play codegolf.


Challenge accepted.

-[>++>++>++<<<-----]>--.---.>+++++++.+.>-.-. Debugger to help you visualize what’s going on. The first brainfuck works by incrementing the first cell to 10, then the loop increments the second cell to 100 and the 3rd cell to 110, and the <<- decrements the loop “counter”, which is held by the first cell.

At the end of the loop we should have [0][100][110]. Everything after the loop just increments or decrements to the appropriate ascii decimal value and outputs to stdout. The second one works by first decrementing the value of the first cell, which is 0; hopefully the bf interpreter will wrap around to 255. Not all bf interpreters do this; does but!/bff doesn’t.

Since the ascii decimal codes of the letters d, m, n, e, d are all in between 100 and 110 (a is 97), the shortest way I could think of was to have a big number to use as the loop counter and decrement it in intervals. 102 is 40% of 255, or 2/5ths, so after incrementing twice for cells 1, 2, and 3 go back to cell 0 and decrement by 5. At the end of the loop we should have [0][102][102][102].

Some interesting bf-related links: add, dup, swap, mul, if implemented in bf.


Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now