Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: Assignment:
- ::
- :: Build a naked generator that takes a noun and checks if that noun is a cell or an atom.
- :: If that input noun is an atom, check if itβs even or odd.
- :: The output should be of the tape type. A tape is a string.
- ::
- |= a=* :: gate
- ?: ?= @ a :: a is an atom?
- ?: .= 0 (mod a 2) :: a is even?
- 'even' :: even!
- 'odd' :: odd!
- 'not an atom' :: not an atom
- ::
- :: or in one line :
- :: ?@(a ?:(=((mod a 2) 0) 'even' 'odd') 'not an atom')
- ::
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement