leo/compiler/tests/function/iteration.leo

13 lines
165 B
Plaintext
Raw Normal View History

2020-06-23 04:28:30 +03:00
function one() -> u32 {
2020-07-17 22:59:18 +03:00
return 1u32
2020-06-23 04:28:30 +03:00
}
2020-07-30 22:10:33 +03:00
function main() {
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 += one();
}
2020-06-23 04:28:30 +03:00
2020-08-17 05:14:26 +03:00
console.assert(a == 10u32);
2020-06-23 04:28:30 +03:00
}