Created
January 12, 2015 05:47
-
-
Save lexszero/ad062d7d9b7693006380 to your computer and use it in GitHub Desktop.
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
/* well, let's see who you are... */ | |
int cmd_allowed(const char *s) | |
{ | |
const char **c; | |
/* god is powerful */ | |
if (godmode_active()) | |
return 1; | |
/* don't hide your thoughts in emptiness */ | |
while (*s && (*s == ' ' || *s == '\t')) | |
s++; | |
/* though absolute voidness is just fine */ | |
if (!*s) | |
return 1; | |
/* sadly, the most cases are very utilitarian and predictable, but you can go this way */ | |
for (c = allowed_cmd; *c; c++) | |
if (strcmp(s, *c) == 0) | |
return 1; | |
/* still here? lol, you lose. */ | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment