Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ help with dirty dice game? I started the code and this is what i have so far if that helps 6 using namespace std;
C++ help with dirty dice game? I started the code and this is what i have so far if that helps
6 using namespace std; 7 8 int playerlpts-100; 9 int player2pts-100; 10 int turntotal; 11 int decision-1; 12 13 int turn rand ( ) % 2 + 1 14 15 cout>winningvalue; 17 18 int over#0 ; 20 int roll- 21 22 int main 24 while (lover) 23 25 26 27 28 coutsc"would you like to roll(1) or hold (2)2: ">decision; while(decision-1) 31 32 roll-rand ( ) % 6 + 1 ; turntotal-roll+turntotal; 34 cout>decision; if decision-2 if turn-1 playerlpts-playerlpts+turntotal; if turn 2 player2pts-player2pts+turntotal; 45 46 if playerlpts-winningvalue over:l: 48 49 50 if player2pts-winningvalue over:l: 52 53 54 if turn-1 turn++ if turn=2 turn- turntotal#0; 57 58 6 using namespace std; 7 8 int playerlpts-100; 9 int player2pts-100; 10 int turntotal; 11 int decision-1; 12 13 int turn rand ( ) % 2 + 1 14 15 cout>winningvalue; 17 18 int over#0 ; 20 int roll- 21 22 int main 24 while (lover) 23 25 26 27 28 coutsc"would you like to roll(1) or hold (2)2: ">decision; while(decision-1) 31 32 roll-rand ( ) % 6 + 1 ; turntotal-roll+turntotal; 34 cout>decision; if decision-2 if turn-1 playerlpts-playerlpts+turntotal; if turn 2 player2pts-player2pts+turntotal; 45 46 if playerlpts-winningvalue over:l: 48 49 50 if player2pts-winningvalue over:l: 52 53 54 if turn-1 turn++ if turn=2 turn- turntotal#0; 57 58Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started