Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
3
Task/Factorial/Nu/factorial.nu
Normal file
3
Task/Factorial/Nu/factorial.nu
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
def 'math factorial' [] {[$in 1] | math max | 1..$in | math product}
|
||||
|
||||
..10 | each {math factorial}
|
||||
4
Task/Factorial/Uxntal/factorial.uxnatl
Normal file
4
Task/Factorial/Uxntal/factorial.uxnatl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
@factorial ( n* -: fact* )
|
||||
ORAk ?{ POP2 #0001 JMP2r }
|
||||
DUP2 #0001 SUB2 factorial MUL2
|
||||
JMP2r
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import "/fmt" for Fmt
|
||||
import "/big" for BigInt
|
||||
import "./fmt" for Fmt
|
||||
import "./big" for BigInt
|
||||
|
||||
class Factorial {
|
||||
static iterative(n) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
defn factorial(x):
|
||||
apply(*): (2 .. x)
|
||||
!yamlscript/v0
|
||||
|
||||
say: factorial(10)
|
||||
defn factorial(x):
|
||||
apply *: 2..x
|
||||
|
||||
say: factorial(20)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue