mirror of
https://github.com/open-goal/jak-project
synced 2026-06-25 18:14:34 -04:00
11 lines
185 B
Common Lisp
11 lines
185 B
Common Lisp
(defun factorial-iterative ((x integer))
|
|
(let ((result 1))
|
|
(while (!= x 1)
|
|
(set! result (* result x))
|
|
(set! x (- x 1))
|
|
)
|
|
result
|
|
)
|
|
)
|
|
|
|
(factorial-iterative 10) |