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
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
func<int> add(int a, int b)
|
||||
func<int> add(int: a, int: b)
|
||||
{
|
||||
return a + b
|
||||
}
|
||||
|
||||
func<int> main()
|
||||
{
|
||||
int c = add(3, 4)
|
||||
int: c = add(3, 4)
|
||||
if (c == 7)
|
||||
{
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user