Changed how variables are created
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
func<int> fib(int num)
|
||||
func<int> fib(int: num)
|
||||
{
|
||||
# Base cases #
|
||||
if (n == 0) { return 0 }
|
||||
if (n == 1) { return 1 }
|
||||
# Base cases (temp excluded) #
|
||||
# if (n == 0) { return 0 } #
|
||||
# if (n == 1) { return 1 } #
|
||||
|
||||
# RECURSION BABYYYY #
|
||||
return fib(n - 1) + fib(n - 2)
|
||||
@@ -10,6 +10,6 @@ func<int> fib(int num)
|
||||
|
||||
func<int> main()
|
||||
{
|
||||
int res = fib(8)
|
||||
int: res = fib(8)
|
||||
return res == 21
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user