Last active
June 28, 2016 16:14
-
-
Save felko/9b1ccb929f62e552bc0c to your computer and use it in GitHub Desktop.
Loads in memory the fibonacci suite (but doesn't display it)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FIBONACCI SEQUENCE | |
You have to use an IDE or website in order to visualize the memory | |
+++++++> The number of numbers to load | |
+>+> Setup the two first numbers | |
<[<]>[ | |
[>] Move to the right most ptr | |
<< [->>+>+<<<] Store the first number in the 2 next free ptr | |
>>>[<<<+>>>-] Shift the last value in the first number ptr | |
<< [->>+>+<<<] Store the second number in the 2 next free ptr | |
>>>[<<<+>>>-] Shift the last ptr into the second number ptr | |
< [-<+>] Add up the last 2 ptr | |
<[<]>-] Move to the leftmost ptr and decrement it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment