Skip to content

Instantly share code, notes, and snippets.

Created April 4, 2013 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/5311870 to your computer and use it in GitHub Desktop.
Save anonymous/5311870 to your computer and use it in GitHub Desktop.
bool for_switch_state_machine_wtf() {
int state = 1
for(;;) {
switch(state) {
case 1:
if (!do_some_stuff())
return false;
state = 2;
break;
case 2:
if (!do_some_other_stuff())
return false;
return true;
default:
return false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment