🐐 Examples

This commit is contained in:
2026-04-01 14:15:06 +02:00
parent 334f0ea5a4
commit 2f138093e3
8 changed files with 97 additions and 0 deletions

12
examples/factorial.cent Normal file
View File

@@ -0,0 +1,12 @@
// 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()))