in Clojure, Programming, Uncategorized

Ackermann function in Clojure, verion 1

(defn ack [m n]
  (if (= m 0)
    (inc n)
    (if (= n 0)
      (ack (dec m) 1)
      (ack (dec m) (ack m (dec n))))))

Write a Comment

Comment