code wiki / (root) / _offc_bisect_while_sum.nx

_offc_bisect_while_sum.nx source

↩ module page · 9 lines · 218 B

1// _offc_bisect_while_sum.nx -- Bar-3 feature bisect: while_loop 2 3func main() -> i64 { 4 var i: i64 = 0 5 var sum: i64 = 0 6 while i < 10 { sum = sum + i; i = i + 1 } 7 if sum == 45 { return 0 } 8 return 1 9}