A BOFH Generator in C

// gcc bofh.c -o bofh #include <stdio.h> #include <stdlib.h> #include <time.h>

#define NUM_QUOTES 10

const char* bofh_quotes[NUM_QUOTES] = { “No, my powers can only be used for good.”, “It must be a hardware problem.”, “I’m sorry, we don’t support that feature.”, “That’s a PEBCAK error (Problem Exists Between Chair And Keyboard).”, “Have you tried turning it off and on again?”, “The BOFH Excuse Server is down.”, “It works for me.”, “I’m afraid I can’t help you with that.”, “According to the manual, it should work.”, “You must have done something wrong.” };

int main() { srand(time(NULL)); // seed the random number generator

int random\_index = rand() % NUM\_QUOTES;
const char\* quote = bofh\_quotes\[random\_index\];

printf("%s\\n", quote);

return 0;


Published At