Advertisement
keatondunsford

Untitled

Jan 25th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. :: (*unsolved*)
  2. :: gen/problem--add.hoon
  3. :: Produce the sum of two unsigned atoms a and b.
  4. |= {a/@ b/@}
  5. |- ^- @
  6. ?~ a b
  7. %= $
  8. a =+ c=0 |- ?: =(a +(c)) c $(c +(c))
  9. b +(b)
  10. ==
  11. ::$(a (dec a), b +(b))
  12. ::::
  13. :: one-liner-adder
  14. != |= {a/@ b/@} |- ^- @ ?~ a b %= $ a =+ c=0 |- ?: =(a +(c)) c $(c +(c)) b +(b) ==
  15. ::
  16.  
  17. [ 8
  18. [1 0 0]
  19. [ 1
  20. 8
  21. [ 1
  22. 6
  23. [5 [1 0] 0 28]
  24. [0 29]
  25. 9
  26. 2
  27. [0 2]
  28. [0 6]
  29. [ [ 8
  30. [1 0]
  31. 8
  32. [ 1
  33. 6
  34. [5 [0 124] 4 0 6]
  35. [0 6]
  36. 9
  37. 2
  38. [0 2]
  39. [4 0 6]
  40. 0
  41. 7
  42. ]
  43. 9
  44. 2
  45. 0
  46. 1
  47. ]
  48. 4
  49. 0
  50. 29
  51. ]
  52. 0
  53. 15
  54. ]
  55. 9
  56. 2
  57. 0
  58. 1
  59. ]
  60. 0
  61. 1
  62. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement