Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: Recaman's Sequence in Hoon
- |= limit=@
- %- flop
- ^- (list @)
- ?: =(0 limit)
- ~
- =/ result=(list @) ~[0]
- |-
- ?: =((lent result) limit)
- result
- =/ n (dif:si (new:si & -.result) (new:si & (lent result)))
- =/ p (abs:si n)
- ?: ?&((syn:si n) =(~ (fand ~[p] result)))
- $(result [p result])
- $(result [(add -.result (lent result)) result])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement