All pastes #2049696 Raw Edit

Stuff

public text v1 · immutable
#2049696 ·published 2011-04-23 13:25 UTC
rendered paste body
#include <stdio.h>
#include <stdlib.h>

int ask(char *question) {
	int c;

	printf("%s (y/n)\n", question);
	while ((c = getchar()) == '\n');
	if (c < 0)
		exit(1);
	return c;
}

int main(int argc, char *argv[]) {
	switch(ask("Is it working?")) {
		case 'y':
			printf("Don't mess with it.\n");
			return 0;
		case 'n':
			switch(ask("Did you mess with it?")) {
				case 'y':
					goto idiot;
			}
	}
	idiot:
		switch(ask("YOU IDIOT!\nAnyone else know?")) {
			case 'y':
				goto screwed;
			case 'n':
				printf("Hide it.\n");
				return 0;
			default: goto idiot;
		}
	screwed:
		printf("You're screwed!\n");
		while (1) {
			switch(ask("Can you blame someone else?")) {
				case 'y':
					printf("No problem.\n");
					return 0;
				case 'n':
					goto screwed;
			}
		}
}