scheme-playground/factorial.scm

6 lines
105 B
Scheme
Raw Permalink Normal View History

(define (factorial n)
(cond ((= n 2) 2)
(else (* (factorial (- n 1)) n))))
(print (factorial 10000))