navid/haze / 7eea2cb1926ee325695e6280006567c1ef7c32c933373cb43301fc2775c98ac3 / 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
}