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


int main()
{

    int dicea=(rand()%6);
    int diceb=(rand()%6);
    int dicec=(rand()%6);
    int diced=(rand()%6);
    int total = (dicea + diceb + dicec +3);
    char name[20];
    char answer;
    printf("Enter your name to start game\n");
    scanf(" %s", &name);

    printf("\nTotal of 3 diceroll results: %d \n", total);
    printf("Now your turn, \n");
    printf("is next roll higher or lower ? (h/l)\n");
    scanf(" %s", &answer);

    if (diced < 4) {
        if (answer == 'l') {
            printf("Nice shout %s", name);
        }else {printf("Sorry %s you failed try again.", name);}
    }
}