Files
centvrion/examples/factorial.cent
2026-04-01 14:15:06 +02:00

12 lines
199 B
Plaintext

// Calculates the factorial of the given number
CVM MAGNVM
DEFINI fact(n) VT {
SI n MINVS I TVNC {
REDI(I)
} ALVID {
REDI(n * INVOCA fact(n - I))
}
}
DICE(INVOCA fact(AVDI_NVMERVS()))