Created
November 24, 2015 18:38
-
-
Save winstonewert/cff27cda090d518506fa 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
#include <stdlib.h> | |
#include <string.h> | |
#define false 0 | |
#define true 1 | |
typedef int bool; | |
bool error(int depth) { | |
if(depth == 0) { | |
return true; | |
} else { | |
if (!error(depth-1)) return false; | |
if (!error(depth-1)) return false; | |
if (!error(depth-1)) return false; | |
if (!error(depth-1)) return false; | |
if (!error(depth-1)) return false; | |
if (!error(depth-1)) return false; | |
} | |
return true; | |
} | |
void no_error(int depth) { | |
if(depth == 0) { | |
return; | |
} else { | |
no_error(depth-1); | |
no_error(depth-1); | |
no_error(depth-1); | |
no_error(depth-1); | |
no_error(depth-1); | |
no_error(depth-1); | |
} | |
} | |
int main(int argc, char **argv) { | |
int depth = atoi(argv[1]); | |
if (strcmp(argv[2], "e") == 0) { | |
error(depth); | |
} else { | |
no_error(depth); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment