YahtC is a dice game (very) loosely modeled on Yahtzee(tm) BUT YahtC is not Yahtzee(tm).

Rules of YahtC:

5 dice are rolled

The user selects which dice to roll again.

The user may choose to roll none or all 5 or any combination.

And then the user selects which dice to roll, yet again.

After this second reroll the turn is scored.

Scoring is as follows:

50 points 5 of a kind scores 50 points.
45 points No pairs (all unique) scores 45 points.
40 points 4 of a kind scores 40 points.
30 points 3 of a kind scores 30 points.
Total Dice Otherwise score the dice total.
Interface:

To indicate nothing to reroll the user will input 0
This should end the players turn. <--- IMPORTANT
there will be no zero needed for the second reroll if zero is entered on first
Otherwise the user will indicate which dice to reroll by position
135 would indicate to reroll the first, third and last die (IN THAT ORDER!).<--- IMPORTANT
The numbers do not have to be given in order (but must be rolled in the order given)
Output:

You will show the user the result of each roll and request which dice to re-roll. The dice must not be sorted for this purpose. (Or the tester will choke) At the end of the seventh turn you will produce a score sheet like the following:

----------
SCORESHEET
----------
Turn 1: 30
Turn 2: 21
Turn 3: 30
Turn 4: 30
Turn 5: 19
Turn 6: 17
Turn 7: 16
==========
Total: 163
Other Requirements:

You must use the template. The code in the template must remain. Specifically

int main(int argc, char ** argv){
seed(argc, argv);
will be required for correct scoring. The seed function will set the random number generator to specific sequences that can be repeated. The template will also provide a function that prints the game rules instructions but its presence or absence will not affect grading.

YahtC -- rolling the dice

Use the expression (rand()%6+1) to simulate a roll of the dice.
rand() is a function that generates a random positive integer.
%6 modulates the random integer into a range 0..5
+1 makes the range 1..6 just like a dice is expected.
In the tester I make use of the fact that I can control the random numbers generated -- do not call rand() more than required or the numbers you use will not be the numbers expected to be generated by the tester.
Do not call seed again. This will result in a different than expected set of numbers.
YahtC -- re-rolling the dice

When the user chooses to reroll the reroll needs to happen in order left to right
If the user rerolls: 135, first roll die 1 then die 3 then die 5.
Otherwise if we reroll only 3 or 5 on the last try we won't be rolling the same die.
Library differences

You are not guaranteed the Zybooks rand() is the same as your rand()
just as we may have difference with strcmp() (some libraries always return -1, 0, 1, some don't)

Q&A Education