source: trunk/Examples/Others/fibo7.b

Last change on this file was 11, checked in by chronos, 12 years ago
  • Added: Some other examples from web.
File size: 487 bytes
Line 
1[By Max Grosse <zwoelf11@informatik.uni-jena.de>]
2%%%%%%%
3prints the fibonacci numbers
4this may take some secs (20 plus 2 take 30secs on my box)
5
6the first two are 1
7+.>+.
8
9how many do you want? >>>
10++++++++++++
11[<<<
12
13copy /1/ to /2/
14[->>+<<]>>[-<+<+>>]
15
16add /0/ to /1/
17<<<[->+<]>>
18
19move /2/ to /0/
20[-<<+>>]
21
22output /1/
23<.
24
25move to /3/ and decrement (break condition)
26>>>-
27]
28
29[[
30%%%%%%%%%%
31as block:
32+.>+.>>>++++++++++++[<<<[->>+<<]>>
33[-<+<+>>]<<<[->+<]>>[-<<+>>]<.>>>-]
34%%%%%%%%%%%
35]]
36
Note: See TracBrowser for help on using the repository browser.