2010-07-22 14:11:39 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
|
|
|
|
iter range(int a, int b) -> int {
|
|
|
|
assert (a < b);
|
|
|
|
let int i = a;
|
|
|
|
while (i < b) { put i; i += 1; }
|
2010-07-22 14:11:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2011-06-15 13:19:50 -05:00
|
|
|
let int sum = 0;
|
|
|
|
for each (int x in range(0, 100)) { sum += x; }
|
|
|
|
log sum;
|
2010-07-22 14:11:39 -05:00
|
|
|
}
|