whalesong/examples/fact.rkt
2011-09-10 15:21:49 -04:00

9 lines
125 B
Racket

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