Skip to content

Instantly share code, notes, and snippets.

@lamdor
Created January 3, 2009 13:16
Show Gist options
  • Save lamdor/42839 to your computer and use it in GitHub Desktop.
Save lamdor/42839 to your computer and use it in GitHub Desktop.
(ns tak)
(defn tak [x y z]
(let [x (int x)
y (int y)
z (int z)]
(if (<= x y)
z
(recur (tak (dec x)
y z)
(tak (dec y)
z x)
(tak (dec z)
x y)))))
(time (dotimes [_ 1000]
(tak 24 16 8)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment