aboutsummaryrefslogtreecommitdiff
path: root/examples/12-while/src/Counting.shed
blob: 1b1c5dede558f28c17d10b6e1997e7708c4d673b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
fun message(count: Int) -> String {
    if (count == 1) {
        "one\n"
    } else if (count == 2) {
        "two\n"
    } else {
        "many\n"
    }
}

pub fun main() ! Io -> Unit {
    var count = 1;

    while (count != 4) {
        print!(message(count));
        set count = count + 1;
    }
}