Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. |= end=@ :: 1
  2. =/ count=@ 1 :: 2
  3. |- :: 3
  4. ^- (list @) :: 4
  5. ?: =(end count) :: 5
  6. ~ :: 6
  7. :- count :: 7
  8. $(count (add 1 count)) :: 8
  9.  
  10. "Our program is simple, so the entire program is the gate that's being created here. The rest of our lines of code are part of the second child of our gate, and they determine how our gate produces an output."
  11.  
  12. CHILDREN:
  13. |=
  14. 1: end=@
  15. 2: lines 2-8? (or more directly, just line 2...)
  16. =/
  17. 1: count=@
  18. 2: 1
  19. 3: no idea. is it just line 3?
  20. |-
  21. 1: must be line 4: ^-
  22. ^- (i think this just casts?)
  23. 1: (list @)
  24. 2: conditional rune in line 5?
  25. ?:
  26. 1. the conditional: =(end count)
  27. 2. branch if true: ~
  28. 3. branch if false: cell created in 7-8
  29. :-
  30. 1. count
  31. 2. $(count (add 1 count))
  32. ^^ $ says restart recursion, with count replaced by count+1
  33.  
  34.  
  35.  
  36. create_gate( ##### |=
  37. end=@,
  38. assign_count( ##### =/
  39. count=@,
  40. 1,
  41. define_recursion( ##### |-
  42. constrain_output( ##### ^-
  43. (list @),
  44. conditional_branch( ##### ?:
  45. =(end count),
  46. ~,
  47. create_atom_and_recurse( ##### :-
  48. count,
  49. $(count (add 1 count))
  50. )
  51. )
  52. )
  53. )
  54. )
  55. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement