/* Coded by Ben Jacobs of Nonsense Software 2000.  
 * Personal comments: I whipped this together in about half an hour and it's
 * the first game I've ever programmed in C.  For some reason the random 
 * number generator doesn't work that well, I try to fix it so it works better
 * sometime.  Send comments to dooberwah@crosswinds.net
 */

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

void seedrnd(void);

int main(void)
{
	int i, r, d;
	char key;

	for(i=0;i<10;i++)
	{
		seedrnd();
		if(d==1)
			break;
		printf("\nBovine Roulette\n");
		printf("You are on cow %i of 10.\n",i);
		printf("Press \"m\" to start [m]ilking. ");
		for(;;)
		{
			key=getchar();
			if(key=='m')
				break;
		}
		r=rand()%100;
		if(r>10)
		{
			printf("Oops, you got kicked by the cow you were milking and died.\n");
			d=1;
		}
		if(r==11)
		{
			printf("The cow who you were milking's bullfriend comes to her rescue and beats you up. You die.\n");
			d=1;
		}
		if(r<12)
		{
			printf("You milk the cow without getting kicked. Onward to the next one!\n");
		}
	}
	if(d==1)
	{
		printf("Darn, it seems you have died.  Check out www.nonsensesoftware.com for more \"cool\" games by");
		printf(" Nonsense Software.\n");
	}
	if(d==0)
	{
		printf("YAY! You won! (this should make you feal very happy for no reason at all)  Check out");
		printf("www.nonsensesoftware.com for more \"cool\" games by nonsense Software.");
	}
}

void seedrnd(void)
{
	srand((unsigned)time(NULL));
}
