Skip to content

Instantly share code, notes, and snippets.

@dynoChris
Last active July 30, 2020 00:44
Show Gist options
  • Save dynoChris/e1d36a23d96707a80e55e67072215543 to your computer and use it in GitHub Desktop.
Save dynoChris/e1d36a23d96707a80e55e67072215543 to your computer and use it in GitHub Desktop.
Switcher pattern
int switcher = 0;
int countLaps = 3;
switch (switcher) {
case 0:
switcher = (switcher+1)%countLaps;
break;
case 1:
switcher = (switcher+1)%countLaps;
break;
case 2:
switcher = (switcher+1)%countLaps;
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment