Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 0 1 x r 0 ; Mark first number with x's.
- 0 _ s r 1 ; Mark space with s and start marking second number.
- 1 1 x r 1 ; Mark second number with x's.
- 1 _ s l 2 ; Start looking for digits to add.
- 2 x 1 r 3 ; Found digit to add -- now add.
- 2 _ _ r 4 ; Finished parsing all numbers -- clean up.
- 2 * * l 2 ; Ignore everything else.
- 3 _ z l 2 ; Add digit -- now look for more digits.
- 3 * * r 3 ; Ignore everything else.
- 4 s _ r 4 ; Replace s with _.
- 4 z 1 r 4 ; Replace z with 1.
- 4 _ _ l 5 ; Finished cleaning up -- now move to second-to-last number.
- 4 * * r 4 ; Ignore everything else.
- 5 1 1 l 5 ; Move past last number.
- 5 _ _ l 6 ; Begin moving past second-to-last number.
- 6 1 1 l 6 ; Move past second-to-last number.
- 6 _ _ r 0 ; Moved to correct location -- now produce next Fibonacci number.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement