Author: Sean Colombo Date: 10/7/04 This program will print out a series of Fibonacci numbers It is written in Brainfuck (and it's my first program; Hello World is hackeneyed) Start Here: //NOTE: each time a number is printed it will have to have 48 added to it first to give the ASCII value (which is what BF prints) Registers: 0 Counter 1 a: lower Fib num 2 b: higher Fib num 3 c: new Fib sum (temporary) 4 \n: a value of 13 to act as a printable line break 5 "0": a value of 48 to add to numbers to get the ascii values 6 output buffer: where numbers are added to the 48 and then displayed 7 temp 8 to 29999 unused //Store 5 in a register; this will be the number of iterations to do (which will generate 7 Fibonacci numbers because of the first two static vals) +++++ //Store 13 in the fifth register to use as a linebreak >>>>+++++++++++++ //Store 48 in the sixth register to use to give numbers ascii values > ++++++++++ ++++++++++ ++++++++++ ++++++++++ ++++++++ //Store 0 and 1 in registers to be used as the a and b values (0 is implicit) <<<+ //Print the 0 then the linebreak; then the 1; then leave the register at 48 >>>[>+>+<<-]>>[<<+>>-]<.<<.>>+.<<.>>- //Point to the register with the 8 in it <<<<<< //Start a loop [ //move the first register into a third >[>>+<<-] //add the second into the third and then leave seconds val in first >[<+>>+<-] //move the third value to the second >[<+>-] //add the second value (third register) to the output buffer which already contains 48 and print it and a line break <[>+>>>+<<<<-]>[<+>-]>>>.<<.>> //clear the output register then refill it with a copy of the 48 [-]<[>+>+<<-]>>[<<+>>-] //move the pointer to the register with the counter in it and decrement one <<<<<<<- ] Fin (EOF)