public
Created

  • Download Gist
theTest.c
C
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
#include <stdio.h>
#include <string.h>
#include <unistd.h>
 
void theTest();
 
int main() {
printf("Be you robot? Or human?\n");
 
char* passwd;
scanf("%s", passwd);
 
if (strcmp(passwd, "human") == 0) {
for (;;) {
printf("GET THE HUMANOID\n");
}
} else if (strcmp(passwd, "robot") == 0) {
printf("\nADMINISTER THE TEST.\n");
sleep(3);
theTest();
}
 
return 0;
}
 
void theTest() {
printf("\nWhich of the following would you most prefer?\n");
printf("A) a puppy,\n");
printf("B) a pretty flower,\n");
printf("Or C), a large, properly formatted, data file?\n");
 
char choice[1];
scanf("%s", choice);
 
if (strcmp(choice, "A") == 0) {
for (;;) {
printf("GET THE HUMANOID\n");
}
} else if (strcmp(choice, "B") == 0) {
printf("\nAcceptable, you may enter.\n");
} else if (strcmp(choice, "C") == 0) {
printf("\nCorrect, you may enter.\n");
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.