Hi guys I'm having major issues with this assignment of mine and I cant even figure out where to get started. Any help would be greatly appriciated.
I must write a program that outputs that plays the game Hi Lo with a user until they decide to quit. The program should continue playing Hi Lo keeping an updated score until the user elects to quit.
The rules of Hi Lo (for the purposes of this assignment) are as follows:
The game is played with a standard deck of playing cards
The player is dealt one card face up so the value is visible.
The player must guess if the next card will be higher or lower than the visible card.
The second card is dealt. If the player is correct, a point is awarded. If the player is incorrect, a point is subtracted from the score.
If the second card is the same value as the first card, the score does not change.
Gameplay repeats for as many rounds as desired
There are several right ways to accomplish each of the requirements below.
My game must allow the user to play as many rounds of HiLo as desired without restarting the program. (use a loop)
Each round should follow the rules listed earlier in the assignment description.
The score must accumulate for the entire play session (until the user quits)
When the user quits, print out the final score
Use rand to pick a card.
The numbered cards 2-10 will be represented as the numbers 2-10 and jack, queen, king and ace will be represented as 11 through 14 respectively.
I will need to ask the user to enter one three menu options for each card: high (1), low (2), or quit(0)
Use 1, 2, 0 as the input for the menu choices (as shown above)
Check the users input to make sure it is only one of the allowed options. Program defensively
I will need to keep track of the users score and print it out every round, including at the end when the user quits.
this is all I have so far (sad I know)
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void)
{
int randomNumber;
int sizeOfDeck;
int guess;
sizeOfDeck = 13;
srand (time(NULL));
randomNumber = rand()%sizeOfDeck+2;
printf("The Current Card Is a: %d\n", randomNumber);
printf("Will the next card be higher(1) or lower(2)? (press 0 to quit)\n");
scanf("%d", &guess);
return 0;
}