factorial.gsp 212 B

123456789
  1. (ns main
  2. "fmt"
  3. "github.com/jcla1/gisp/core")
  4. (def main (fn []
  5. (fmt/printf "10! = %d\n" (int (assert float64 (factorial 10))))))
  6. (def factorial (fn [n]
  7. (if (< n 2) 1 (* n (factorial (+ n -1))))))