O'Reilly logo

Good Math by Mark C. Chu-Carroll

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required