Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
9
Task/Factorial/SuperCollider/factorial-1.sc
Normal file
9
Task/Factorial/SuperCollider/factorial-1.sc
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
f = { |n| (1..n).product };
|
||||
|
||||
f.(10);
|
||||
|
||||
// for numbers larger than 12, use 64 bit float
|
||||
// instead of 32 bit integers, because the integer range is exceeded
|
||||
// (1..n) returns an array of floats when n is a float
|
||||
|
||||
f.(20.0);
|
||||
2
Task/Factorial/SuperCollider/factorial-2.sc
Normal file
2
Task/Factorial/SuperCollider/factorial-2.sc
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
f = { |n| if(n < 2) { 1 } { n * f.(n - 1) } };
|
||||
f.(10);
|
||||
Loading…
Add table
Add a link
Reference in a new issue