Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
11
Task/Fibonacci-sequence/NGS/fibonacci-sequence.ngs
Normal file
11
Task/Fibonacci-sequence/NGS/fibonacci-sequence.ngs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
F fib(n:Int) {
|
||||
n < 2 returns n
|
||||
local a = 1, b = 1
|
||||
# i is automatically local because of for()
|
||||
for(i=2; i<n; i=i+1) {
|
||||
local next = a + b
|
||||
a = b
|
||||
b = next
|
||||
}
|
||||
b
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue