Created
April 18, 2024 20:21
-
-
Save Chemaclass/a964412b10a73c0fc251d8e8cd2c0e14 to your computer and use it in GitHub Desktop.
A fibonacci implementation written in phel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns phel-testing\local) | |
(defn fib [n] | |
(loop [fib-nums [0 1]] | |
(if (>= (count fib-nums) n) | |
(slice fib-nums 0 n) | |
(let [[n1 n2] (reverse fib-nums)] | |
(recur (push fib-nums (+ n1 n2))))))) | |
(println (fib 50)) | |
# docs: https://phel-lang.org/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment