navid/haze / cdb8e231610e064f0170f600d0692614cbe824ef935e8d4150816ef72b2fe226 / samples/baseline/02_values.hz

02_values.hz

← samples/baseline · 412 bytes · raw · download

// 02: constants, variables, integer arithmetic.

fn main() {
    const a = 7
    const b = 3
    var total = a + b * 2
    print(total)              // 13
    total = total - 1
    print(total)              // 12
    total += 10
    print(total)              // 22
    print(a / b)              // 2
    print(a % b)              // 1
    print(-a)                 // -7
    print("done")             // done
}