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
9
Task/Ackermann-function/Swift/ackermann-function.swift
Normal file
9
Task/Ackermann-function/Swift/ackermann-function.swift
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
func ackerman(m:Int, n:Int) -> Int {
|
||||
if m == 0 {
|
||||
return n+1
|
||||
} else if n == 0 {
|
||||
return ackerman(m-1, 1)
|
||||
} else {
|
||||
return ackerman(m-1, ackerman(m, n-1))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue