#include #include #include #include #include int main() { char buf[160]; char *line[12] = { "Hi!\n", "Python smells\n", "Children these days!\n", "IDE, SchmIDE!\n", "In my day, they didn't have IDE's.\n", "Please, please, no more!\n", "Numpy, schmumpy!!\n", "Inheritance makes me ill.\n", "There have been no good programming languages since 1985.\n", "Sigh.\n", "No, I won't update my machine! Ubuntu 12.4 forever!\n", "Smart pointers == Dumbass pointers!!!\n" }; srandom(time(0)); printf("Hi!\n"); fflush(stdout); while (1) { usleep(random()%10*100000); if (random()%10 == 0) { fputs(line[random()%12], stdout); fflush(stdout); usleep(random()%10*100000); } if (fgets(buf, 100, stdin) == NULL) exit(0); if (random()%10 == 0 && strchr(buf, 'p') != NULL) { printf("It disgusts me when you say "); fputs(buf, stdout); fflush(stdout); exit(0); } else { fputs(line[random()%12], stdout); fflush(stdout); } usleep(random()%10*100000); } }