Updated and revised some tests
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
//closures
|
||||
fn makeCounter() {
|
||||
var counter: Int = 0;
|
||||
|
||||
fn increment() {
|
||||
return ++counter;
|
||||
}
|
||||
|
||||
return increment;
|
||||
}
|
||||
|
||||
var tally = makeCounter();
|
||||
|
||||
while (true) {
|
||||
var result = tally();
|
||||
|
||||
print result;
|
||||
|
||||
if (result >= 10) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user