Skip to content

Instantly share code, notes, and snippets.

@nmorse
Last active November 13, 2022 18:22
Show Gist options
  • Save nmorse/fa25692e47e2f6857651efcf4723c7d9 to your computer and use it in GitHub Desktop.
Save nmorse/fa25692e47e2f6857651efcf4723c7d9 to your computer and use it in GitHub Desktop.
[6 3 8 4 5 7 2 9 1]
[1 0] # accumulator is a pair [acc index] the index is used to either multiply or add
[swap uncons uncons drop [acc i] [acc [i 2 % 0 ==] [*] [+] ifte 1 i +] pounce [] cons cons]
reduce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment