The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Each turn, a player repeatedly rolls a die until either a 1 is rolled or the player decides to "hold":
The first player to score 100 or more points wins.
For example, the first player, Ann, begins a turn with a roll of 5. Ann could hold and score 5 points, but chooses to roll again. Ann rolls a 2, and could hold with a turn total of 7 points, but chooses to roll again. Ann rolls a 1, and must end her turn without scoring. The next player, Bob, rolls the sequence 4-5-3-5-5, after which he chooses to hold, and adds his turn total of 22 points to his score.
Create this game incorporate the previous project into the program.
The previous project is attached below and must run with no errors with "C" language.
Â
#include <stdio.h>#include <stdlib.h>#include <time.h>int main(void){int i;printf("Press Enter to Roll The Dice\n ");getchar();{srand(time(0));int d = 1 + rand() % 6;if(d==1){printf("___________\n\n");printf("||\n");printf("|0|\n");printf("||\n");printf("___________\n");}if(d==2){printf("___________\n\n");printf("||\n");printf("|00|\n");printf("||\n");printf("___________\n");}if (d== 3){printf("___________\n\n");printf("|0|\n");printf("|0|\n");printf("|0|\n");printf("___________\n");}if (d== 4){printf("___________\n\n");printf("|00|\n");printf("||\n");printf("|00|\n");printf("___________\n");}if (d== 5){printf("___________\n\n");printf("|00|\n");printf("|0|\n");printf("|00|\n");printf("___________\n");}if (d== 6){printf("___________\n\n");printf("|00|\n");printf("|00|\n");printf("|00|\n");printf("___________\n");}return 0;}}
-----------