13 lines
134 B
Plaintext
Raw Normal View History

2024-07-30 14:36:33 +00:00
import log
2024-07-18 16:08:30 +00:00
2024-07-15 14:51:36 +00:00
main() {
2024-07-30 14:36:33 +00:00
log.number(factorial(5))
2024-07-15 14:51:36 +00:00
}
2024-08-05 16:47:24 +00:00
factorial(x Int) -> Int {
2024-07-15 14:51:36 +00:00
if x <= 1 {
return 1
}
return x * factorial(x - 1)
}