#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <ctype.h>


int main()
{
    int roll_1_dice1,roll_1_dice2,roll_1_dice3,roll_1_total;
    int roll_2_dice1,roll_2_dice2,roll_2_dice3,roll_2_total;
    char guess;

    roll_1_dice1 = (rand()%6)+1;
    roll_1_dice2 = (rand()%6)+1;
    roll_1_dice3 = (rand()%6)+1;
    roll_1_total =  roll_1_dice1 + roll_1_dice2 + roll_1_dice3;

    printf(" dice 1 = %d\t dice 2 = %d\t dice 3 = %d\t total= %d\n\n ",roll_1_dice1,roll_1_dice2,roll_1_dice3,roll_1_total);

    roll_2_dice1 = (rand()%6)+1;
    roll_2_dice2 = (rand()%6)+1;
    roll_2_dice3 = (rand()%6)+1;
    roll_2_total =  roll_2_dice1 + roll_2_dice2 + roll_2_dice3;

printf(" guess whether the next dice roll is (h)igher (l)ower or (s)ame\n ");
scanf(" %c", &guess);
printf("dice 1 = %d\t dice 2 = %d\t dice 3 = %d\t total= %d\n\n",roll_2_dice1,roll_2_dice2,roll_2_dice3,roll_2_total);

    switch(guess){
case 'h':
    if(roll_2_total>roll_1_total){
        printf("\nIndeed its higher");}
        else
printf("its not higher");
 break;

case 'l':
    if(roll_2_total<roll_1_total){
        printf("\nIndeed its lower");}
        else
printf("its not lower");
  break;

case 's':
     if(roll_2_total==roll_1_total)
        printf("\nyou are a good guesser!\n");
        else
printf("its not the same");
        break;

default: //if the user type another letter
    printf("\ntry again\n");
    break;
}
return 0;
}