leo/compiler/tests/function/iteration_repeated.leo

15 lines
209 B
Plaintext
Raw Normal View History

2020-06-23 04:28:30 +03:00
function iteration() -> u32 {
2020-07-17 22:59:18 +03:00
let mut a = 0u32;
2020-06-23 04:28:30 +03:00
2020-07-17 22:59:18 +03:00
for i in 0..10 {
a += 1;
}
2020-06-23 04:28:30 +03:00
2020-07-17 22:59:18 +03:00
return a
2020-06-23 04:28:30 +03:00
}
2020-07-30 22:10:33 +03:00
function main() {
let total = iteration() + iteration();
2020-08-17 05:14:26 +03:00
console.assert(total == 20);
2020-06-23 04:28:30 +03:00
}