[ create a new paste ] login | about

Link: http://codepad.org/IiqI56ti    [ raw code | fork ]

C++, pasted on May 24:
void Next(state) {
    switch (state) {
    case INITIAL:
        Thing1();
        break;
    case THING1:
        Thing2();
        break;
    case THING2:
        Thing3();
        break;
    case THING3:
        // do nothing -- exit
        break;
    }
}

void DoThing1() {
    // Do "thing 1"
    Next(THING1);
}

void DoThing2() {
    // Do "thing 2"
    Next(THING2);
}

void DoThing3() {
    // Do "thing 3"
    Next(THING3);
}


Create a new paste based on this one


Comments: