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 | %%%%%%%
|
---|
3 | prints the fibonacci numbers
|
---|
4 | this may take some secs (20 plus 2 take 30secs on my box)
|
---|
5 |
|
---|
6 | the first two are 1
|
---|
7 | +.>+.
|
---|
8 |
|
---|
9 | how many do you want? >>>
|
---|
10 | ++++++++++++
|
---|
11 | [<<<
|
---|
12 |
|
---|
13 | copy /1/ to /2/
|
---|
14 | [->>+<<]>>[-<+<+>>]
|
---|
15 |
|
---|
16 | add /0/ to /1/
|
---|
17 | <<<[->+<]>>
|
---|
18 |
|
---|
19 | move /2/ to /0/
|
---|
20 | [-<<+>>]
|
---|
21 |
|
---|
22 | output /1/
|
---|
23 | <.
|
---|
24 |
|
---|
25 | move to /3/ and decrement (break condition)
|
---|
26 | >>>-
|
---|
27 | ]
|
---|
28 |
|
---|
29 | [[
|
---|
30 | %%%%%%%%%%
|
---|
31 | as block:
|
---|
32 | +.>+.>>>++++++++++++[<<<[->>+<<]>>
|
---|
33 | [-<+<+>>]<<<[->+<]>>[-<<+>>]<.>>>-]
|
---|
34 | %%%%%%%%%%%
|
---|
35 | ]]
|
---|
36 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.