nelhage debugs shit — Writing a Brainfuck Quine

nelhage debugs shit lightly-edited tales of debugging systems I was drinking with some coworkers and mentioned I’d never written a brainfuck quine. So, of course, as soon as we got back to computers, they start timing me. It took me just over 30 minutes to produce this incredibly-verbose quine . I figured I’d do a quick writeup of how it works. If you’re not familiar with Brainfuck, you can get a quick refresher here . It’s incredibly simple, so I won’t go into detail here. Most simple quines can be divided into two parts, which I’ll refer to as the code and the data (obviously they’re all code in the sense that they appear as part of the source, but they’re conceptually very different). The data is just a representation of the source code for the “code”, in some machine-readable way. The job of the code is then to print out the data twice: The first time, in the same for...

Linked on 2014-05-08 19:51:44 | Similar Links