~garritfra/antimony

ref: 5e8aad974f24e782bf8ee9319a238ee1aa0892a0 antimony/examples/leapyear.sb -rw-r--r-- 389 bytes
5e8aad97Garrit Franke fix(ci): deploy action 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// There are no nested expressions yet, so we have to hack a little bit

fn main() {
    let year = 2020
    
    let divisibleBy4 = year % 4 == 0
    let divisibleBy100 = year % 100 != 0
    let divisibleBy400 = year % 400 == 0

    let ly = divisibleBy4 && divisibleBy100

    if ly || divisibleBy400 {
        println("Leap year")
    } else {
        println("Not a leap year")
    }
}