# Control flow: recursion, while, for, break/continue, if/else. def fact(n) { if n <= 1.0 { return 1.0 } return n * fact(n - 1.0) } def sum_range(n) { s = 0.0 for i to n { s = s + i } return s } def first_ge(n, limit) { r = 0.0 for i to n { if i >= limit { r = i break } } return r } print(fact(5.0)) print(sum_range(5.0)) print(first_ge(100.0, 7.0)) # SPDX-License-Identifier: MIT OR Apache-2.0 # SPDX-FileCopyrightText: 2026 The Viv authors