ox

The Ox programming language, compiler and tools (WIP)
Log | Files | Refs | README | LICENSE

ex-while.ox (409B)



void main() {

    print("before");
    int i = 1;
    while(true) {
        print("while true prints once 1/3");
        break;
    }
    while(1) {
        print("while 1 prints once 2/3");
        break;
    }
    while(0) {
        print("should never happen!");
        break;
    }
    while("in vino veritas") {
        print("while string prints once 3/3");
        break;
    }
    print("after");
}