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

int main()
{
    int i;
    int diceRoll;
    char guess;
    int sum = 0;
    int preSum;

        printf("Welcome to the dice game!\n");

        srand(time(0));
        for (i = 0; i<3; i++){
        diceRoll = (rand()%6) + 1;
        printf("%d = %d\n",i , diceRoll);
        sum += diceRoll;
        }
        printf("Press h/s/a");
        scanf(" %c" , &guess);

        srand(time(0));
        for (i = 0; i<3; i++){
        diceRoll = (rand()%6) + 1;
        printf("%d = %d\n",i , diceRoll);
        preSum+= diceRoll;
        printf("The new rolls are %d = %d\n" , i , diceRoll);

        }
         if((sum > previousSum && guess == 'h') || (sum == previousSum && guess == 'a') || (sum < previousSum && guess == 's')){
        printf("\nYour guess is correct. You're awesome!\n\n");
    }else{
        printf("\nYour guess is incorrect. You're dumb.\n\n");
    }

    return 0;
}