Question
can someone help me fix this #include #include using namespace std; int player; int human=0; int rollDie() { return (rand() % 6+1); } void askYoNs()
can someone help me fix this
#include
void askYoNs() { cout<<"Do you want to roll a dice (Y/N)?:"< void printScores(int turnTotal,int humanTotal,int compTotal) { if(player==human) { cout<<"Your turn total is "< int changePlayer(int player) { if(player==human) return 1; return human; } int process(int& turnTotal,int roll,int curr_player,int& humanTotal,int& computerTotal) { if(roll==2 || roll==5) { curr_player=changePlayer(curr_player); turnTotal=0; printScores(turnTotal,humanTotal,computerTotal); } else if(roll==4) { turnTotal=15; ///switch player if(curr_player==human) humanTotal+=turnTotal; else computerTotal+=turnTotal; curr_player=changePlayer(curr_player); turnTotal=0; printScores(turnTotal,humanTotal,computerTotal); } else { ///roll = 1 3 6 turnTotal+=roll; cout<<"Your turn total is "<
Step 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