From the Sublime to the Ridiculous

If that didn’t seem impressive enough, here is a really gorgeous implementation of a Fibonacci sequence generator, complete with documentation. The BF compiler used to write this ignores any character other than the eight commands, so the comments don’t need to be marked in any way; they just need to be really careful not to use punctuation.[16]

 
+++++++++++ number of digits to output
 
> #1
 
+ initial number
 
>>>> #5
 
++++++++++++++++++++++
 
++++++++++++++++++++++ (comma)
 
> #6
 
++++++++++++++++
 
++++++++++++++++ (space)
 
<<<<<< #0
 
[
 
> #1
 
copy #1 to #7
 
[>>>>>>+>+<<<<<<<-]
 
>>>>>>>[<<<<<<<+>>>>>>>-]
 
<
 
divide #7 by 10 (begins in #7)
 
[
 
>
 
++++++++++ set the divisor #8
 
[
 
subtract from the dividend and ...

Get Good Math now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.