Files
centvrion/examples/factorial.cent
2026-04-21 23:46:00 +02:00

12 lines
198 B
Plaintext

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