/*
Historical Note:

Created: Wednesday, October 20, 1993, 11:59:02 PM

This is the original "Fridge Game".
It is also my frist C application to accept user input.
It outputs some raw ANSI colours which you might find offensive.
*/

#include "stdio.h"
#include "conio.h"
#include "stdlib.h"
#include "time.h"

void again();
void rc();

void main ()
{
int fish;
int loo;
randomize();
printf("\33[0;1m\33[2JYou are in a fridge. What do you wanna do? 1) Eat 2) Die 3) Get out of fridge\n");
rc();
while  (fish != 49 && fish != 50 && fish != 51) fish=getch();
if (fish == 49) printf("You eat too much and die.",fish);
if (fish == 50) printf("You die.",fish);
if (fish == 51) printf("You fail and die.",fish);
again();
rc();
printf("Press any key...\n");
fish = getch();

}

void again ()
{
rc();
printf("\n\33[33;1mPlease play again.\33[0;1m\n");
}

void rc ()
{
printf("\33[%dm", random(7)+31);
}