/* ** File: spanking.c ** ** Description: Source code for spanking.exe ** Can be called from command line with ** name of penitent as first argument ** ** Written by: Quillis ** ** Note: This is mostly ANSI 'C' but I have taken a few ** liberties with the language in the interest of having fun ** ** If you don't know what ANSI 'C' means you may get confused. ** As a programmer I am not concerned with that since I ** consider it a hardware problem. ** ** spanking.exe is intended for mature computers only ** */
/* ** define colors */ #define NOT_RED 0 #define RED 1
/* ** define main return codes */ #define WELL_SPANKED 0 #define UN_SPANKED 255
/* ** define swat return codes */ #define BAD_SWAT 0 #define GOOD_SWAT 1
/* ** function for applying spanks */ int swat(FILE *rear_end, int number_of_swats) { int response; int count;
for (count = 1; count <= number_of_swats; number_of_swats++) { fprintf(rear_end, "hard swat\n"); } fscanf(rear_end, "%d", response); return response; }
int main(int argc, char *argv[]) { char scream[1024]; int color = NOT_RED; FILE *rear_end;
if (argc != 2) { /* ** there's nobody to spank */ return UN_SPANKED; }
/* ** prepare rear_end for spanking */ rear_end = fopen(argv[1], "a+");
while (color != RED) { /* ** give rear_end a swat and ** check for response */ if (swat(rear_end, 1) != GOOD_SWAT) { /* ** response was not sufficient so ** add more swats */ swat(rear_end, 10); }
/* ** listen for vocal asknowledgement */ if (gets(scream) == NULL) { /* ** no vocal acknowledgement so add ** more swats */ swat(rear_end, 20); }
/* ** check for coloration */ fscanf(rear_end, "%d", color);
/* ** return to beginning of loop to evaluate color */ } /* end while */
/* ** color and responses are now acceptable */ fclose(rear_end);
/* ** exit with satisfactory conclusion */ return WELL_SPANKED;
} /* end spanking.exe */