Advertisement
yoos

Untitled

Nov 12th, 2012
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. 0 1 x r 0 ; Mark first number with x's.
  2. 0 _ s r 1 ; Mark space with s and start marking second number.
  3. 1 1 x r 1 ; Mark second number with x's.
  4. 1 _ s l 2 ; Start looking for digits to add.
  5.  
  6. 2 x 1 r 3 ; Found digit to add -- now add.
  7. 2 _ _ r 4 ; Finished parsing all numbers -- clean up.
  8. 2 * * l 2 ; Ignore everything else.
  9. 3 _ z l 2 ; Add digit -- now look for more digits.
  10. 3 * * r 3 ; Ignore everything else.
  11. 4 s _ r 4 ; Replace s with _.
  12. 4 z 1 r 4 ; Replace z with 1.
  13. 4 _ _ l 5 ; Finished cleaning up -- now move to second-to-last number.
  14. 4 * * r 4 ; Ignore everything else.
  15.  
  16. 5 1 1 l 5 ; Move past last number.
  17. 5 _ _ l 6 ; Begin moving past second-to-last number.
  18. 6 1 1 l 6 ; Move past second-to-last number.
  19. 6 _ _ r 0 ; Moved to correct location -- now produce next Fibonacci number.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement