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