Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
10
Task/Factorial/MANOOL/factorial-1.manool
Normal file
10
Task/Factorial/MANOOL/factorial-1.manool
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ let rec
|
||||
{ Fact = -- compile-time constant binding
|
||||
{ proc { N } as -- precondition: N.IsI48[] & (N >= 0)
|
||||
: if N == 0 then 1 else
|
||||
N * Fact[N - 1]
|
||||
}
|
||||
}
|
||||
in -- use Fact here or just make the whole expression to evaluate to it:
|
||||
Fact
|
||||
}
|
||||
11
Task/Factorial/MANOOL/factorial-2.manool
Normal file
11
Task/Factorial/MANOOL/factorial-2.manool
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ let rec
|
||||
{ Fact = -- compile-time constant binding
|
||||
{ proc { N } as -- precondition: N.IsI48[] & (N >= 0)
|
||||
{ if N == 0 then 1 else
|
||||
N * Fact[N - 1]
|
||||
}
|
||||
}
|
||||
}
|
||||
in -- use Fact here or just make the whole expression to evaluate to it:
|
||||
Fact
|
||||
}
|
||||
12
Task/Factorial/MANOOL/factorial-3.manool
Normal file
12
Task/Factorial/MANOOL/factorial-3.manool
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ let
|
||||
{ Fact = -- compile-time constant binding
|
||||
{ proc { N } as -- precondition: N.IsI48[] & (N >= 0)
|
||||
: var { Res = 1 } in -- variable binding
|
||||
: do Res after -- return result
|
||||
: while N <> 0 do -- loop while N does not equal to zero
|
||||
Res = N * Res; N = N - 1
|
||||
}
|
||||
}
|
||||
in -- use Fact here or just make the whole expression to evaluate to it:
|
||||
Fact
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue