whalesong/tests/more-tests/fact.rkt
2012-02-16 15:55:54 -05:00

13 lines
165 B
Racket

#lang planet dyoo/whalesong
(define (fact x)
(cond
[(= x 0)
1]
[else
(* x (fact (sub1 x)))]))
(fact 1)
(fact 10)
(fact 100)
(fact 1000)
(fact 10000)