#include <stdio.h>
#include <stdlib.h>
#include <time.h>

void main()
{
	int myrand;
	int low = 0;					//lowest of range
	int high = 1;					//highest of range
	srand(time(NULL));				//seed randomness
	int coin;
	char guess;
	coin = rand() % (high - low + 1) + low;

	printf("Please enter your guess (h or t): ");
	scanf(" %c", &guess);

	if (guess == 'h' && coin == 0)
	{
		printf("You won!\n\n");
	}
	else if (guess == 't' && coin == 1)
	{
		printf("You won!\n\n");
	}
	else
	{
		printf("You didn't win this time :(\n\n");
	}

}
