


	// parallel port variables
        double webcam = pow(2,4);	// webcam DC/DC switch on pin 3
	double pump = pow(2,1);		// pump on DC/AC switch 0
	double strobe = pow(2,2);       // strobe light on DC/AC switch 1
	double light = pow(2,3);	// red light on DC/AC switch 2
	double guillotine = pow(2,0);	// guillotine motor on DC/DC switch on pin 4

        (oup32)(0x0378,0);              // zero parallel port
        while(1) {
                printf("\nHalloween\n");
		printf("Press any key to start.\n");
		printf("Press CTRL-C to quit program.\n");
                ch=0;
		while (ch==0) {
			if(kbhit()) {
				ch = getch();
			}
		}
                // begin sound effects
                printf("Ugly Riot\n");
		(oup32)(0x0378, light);
		if (!PlaySound("halloween.wav", 0, SND_ASYNC | SND_FILENAME)) {
			printf("The sound didn't play!\n");}
		Sleep(3700);	        // 3.7 seconds thunder sound
		(oup32)(0x0378,strobe);
		printf("Thunder and Lightning\n");
                Sleep(5300);	        // 10 seconds trigger webcam
                (oup32)(0x0378, strobe+webcam);
		printf("Webcam tiggered\n");
                Sleep(1000);
		(oup32)(0x0378, strobe+guillotine+pump+webcam);
		printf("Guillotine dropped, blood pumping\n");
		Sleep(1000);             // 11 seconds turn off pump and guillotine motor
		(oup32)(0x0378, strobe+webcam);
		printf("Pump and guillotine motor turned off\n");
                Sleep(9000);		// 20 seconds turn off strobe
		(oup32)(0x0378, 0);
                printf("End of performance.\n");
		printf("Press q to quit program.\n");
		printf("Press any key to continue.\n\n");
                ch=0;
		while (ch==0) {
			if(kbhit()) {
				ch = getch();
				if (ch==113) {
					_outp(0x0378,0);
					return;
				}
                        }
		}
	}


