diff --git a/examples/for_while.con b/examples/for_while.con index 80f9d3e..2f3612d 100644 --- a/examples/for_while.con +++ b/examples/for_while.con @@ -1,18 +1,12 @@ mod Example { fn main() -> i64 { - return sum_to(4); + return sum_to_twice(4); } - fn sum_to(limit: i64) -> i64 { + fn sum_to_twice(limit: i64) -> i64 { let mut result: i64 = 0; let n: i64 = 1; - for (; n <= limit ;) { - result = result + n; - n = n + 1; - } - - n = 1; for (n <= limit) { result = result + n; n = n + 1;