Problem 1: You have two loops controlling each player's turn, but they are not enclosed in an outer loop that will repeat the turns until a condition is met (the winning condition).
Problem 2: You should check the winning condition when the rolled number + turn score + total score is >= 100. In this case you can simply print the winning statement and return.
A possible solution is (I'm using infinite loops and breaks, not very elegant but it should do) :
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int main()
{
int die;
int myScore = 0;
int devilScore = 0;
int turnScore = 0;
char choice;
bool change = false;
bool weHaveAWinner = false;
cout << "Welcome to Devil's Dice! Please select from the following menu: ";
//Enclosing infinite loop, only can exit on return
while (true) {
//Player turn loop, can exit with breaks to main loop
while (true){
cout << "\nRoll [r], Pass [p], or Quit [q].";
cin >> choice;
if(choice == 'r'){
die=(rand() % 6 + 1); //Number generator for die
if(die > 1){
cout << "You rolled a " << die << "." << endl;
turnScore += die;
if (turnScore + myScore >=100) {
cout << "You win!" << endl;
//Winning condition met. Game over and return.
return 0;
}
cout << "You will add " << turnScore << " points if you pass now. ";}
else{
cout << "You rolled a 1. You lose your points and your turn ends." << endl;
turnScore = 0;
//End turn. Breaks secondary loop.
break;
}
}
if(choice == 'p') {
myScore += turnScore;
cout << "Your score is now " << myScore << "." << endl;
turnScore = 0;
change = true;
//End turn. Breaks secondary loop.
break;
} //needs to go to Devil now
if(choice == 'q')
{cout << "\n\tThanks for playing! ";
return 0; }
else if(choice > 'r' || choice < 'p')
{cout << "Please select from the choices listed."; }
}
while (true){
//Devil's turn loop, can exit with breaks to main loop
if(myScore > devilScore && turnScore < 17 || devilScore > myScore && turnScore < 12 || devilScore > 84){
choice='r';
cout << "The Devil rolls! " << endl;
if(choice == 'r'){
die=(rand() % 6 + 1); //Number generator for die
if(die > 1){
cout << "The Devil rolls a " << die << "." << endl;
turnScore += die;
if (turnScore + devilScore >=100) {
//Winning condition met. Game over and return.
cout << "The Devil wins!" << endl;
return 0;
}
}else{
cout << "The Devil rolls a 1. He loses his points and now it's your turn!" << endl;
turnScore = 0;
change = false;
//End turn. Breaks secondary loop.
break;
}
}
}else{
cout << "The Devil chooses to pass. ";
devilScore += turnScore;
choice='p';
turnScore = 0;
cout << "He has " << devilScore << " points. " << endl;
cout << "The Devil now has " << devilScore << " points." << endl;
change = false;
//End turn. Breaks secondary loop.
break;
}
}
}
}