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

int main()
{
    int i,diff;
    int diceRoll[2];
    char ans;

    diceRoll[0] = (rand()%18)+1;
    printf("The 1st dice roll is %d \n", diceRoll[0]);

    for(i=0;i<100;i++){
        printf("Will the next roll be higher(H) or lower(L) or same(S)?  ");
        scanf(" %c", &ans);
        diceRoll[1] = (rand()%18)+1;
        printf("The next dice roll is %d \n", diceRoll[1]);
        diff = diceRoll[0] - diceRoll[1];
        if( ((diff > 0) && (ans == 'L')) || ((diff < 0) && (ans == 'H')) || ((diff == 0) && (ans == 'S')) ){
            printf("You Win!!! \n");
        }else{
            printf("You Suck!!! \n");
        }
        diceRoll[0] = diceRoll[1];
    }
    return 0;
}