-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e161bc
commit 1499719
Showing
8 changed files
with
251 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ todo | |
[//]: # (}) | ||
|
||
- boolean | ||
- closures (lambda expressions) | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var a : Int = 52; | ||
func someOtherFunction(c: Int) -> Int{ | ||
for(var j: Int = 0; j < 32*42; j+= 1;){ | ||
c += 1; | ||
} | ||
return c; | ||
} | ||
|
||
a = someOtherFunction(a); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
var some_param: Int = 1000; | ||
let something = { (some_param) -> Int in | ||
var number = some_param; | ||
repeat { | ||
number /= 10; | ||
} while number > 0 | ||
return number; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
func someOtherFunction(d: Int) -> Int{ | ||
var b: Int = 20; | ||
if( 52 > 43){ | ||
var f: Int = d; | ||
f = 20; | ||
b *= 32; | ||
return b; | ||
} | ||
else { | ||
return b; | ||
} | ||
|
||
} | ||
|
||
func someOtherFunction2(a:Int) -> Int{ | ||
for(var j: Int = 1; j < 21; j += 1;) { | ||
a = j + 5; | ||
} | ||
return a; | ||
} | ||
func someOtherFunction3(a:Int, b:Int) -> Int{ | ||
for(var i: Int = 1; i < 20; i += 1;) { | ||
a += 1; | ||
b += 2; | ||
} | ||
return a; | ||
|
||
} | ||
|
||
func someComplexFunction(A: Int, B: Int, C: Int, D: Int)->Int { | ||
var someResult : Int = 42; | ||
for(var i: Int = 1; i < 3; i += 1;) { | ||
for(var j: Int = 1; j < 3; j += 1;) { | ||
someResult += A * B - C - D + i + j; | ||
} | ||
} | ||
return someResult; | ||
} | ||
|
||
|
||
var a : Int = 0; | ||
|
||
var b : Int = 0; | ||
b = someOtherFunction(43); | ||
a = someOtherFunction3(a,b); | ||
// a = someOtherFunction(52); | ||
|
||
// b = someComplexFunction(42,42,42,42); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters