#include <stdio.h>
#include <stdlib.h>
#include <time.h>


void main()
{
	int flip,guessno;
	int score = 0;
	char guess;
	srand(time(NULL));
	int low = 0, high = 1,i;
	
	for (i = 0;i < 5;i++)
	{
		flip = rand() % (high - low + 1) + low;

		printf("Please enter your guess:");
		scanf(" %c", &guess);

		if (guess == 'h')//convert to a number
		{
			guessno = 0;
		}
		else
		{
			guessno = 1;
		}

		if (flip == guessno)  //compare computer generated with user guess
		{
			printf("Win!!!");
			score = score + 1;
		}
		else
		{
			printf("You didn't win this time");
		}
	}//end for loop
	printf("You scored %d\n", score);
	printf("Computer scored %d\n", 5 - score);
}//end main