Created
April 20, 2012 15:38
-
-
Save RicoP/2429741 to your computer and use it in GitHub Desktop.
Quickloop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define repeat(VAR,TO,ACTION) \ | |
{ \ | |
int VAR = 0; \ | |
switch((TO) % 8) { \ | |
while(VAR != (TO)) { \ | |
ACTION; VAR++; \ | |
case 7: \ | |
ACTION; VAR++; \ | |
case 6: \ | |
ACTION; VAR++; \ | |
case 5: \ | |
ACTION; VAR++; \ | |
case 4: \ | |
ACTION; VAR++; \ | |
case 3: \ | |
ACTION; VAR++; \ | |
case 2: \ | |
ACTION; VAR++; \ | |
case 1: \ | |
ACTION; VAR++; \ | |
case 0: ; \ | |
} \ | |
} \ | |
} | |
int main(int argc, char** argv) { | |
repeat(i, argc, { | |
printf("%s", argv[i]); | |
printf("\n"); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment