Well, I'm writing to make a dice game. I tried searching dice game here but none of it seems to answer my question. This isn't a problem about the dice roll thing anyway. It's about the do while loop. I am very new to this site, I just found out about this via Maximum PC Magazine so please bear with me. Also I am new to programming.
Here is my code:
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main(){
    srand(time(NULL));
    int userRoll = rand() % 6 + 1 ;
    int computerRoll = rand() % 6 + 1 ;
    string yesOrNoChoice;
    string commandToThrowDie;
    do{
        cout << "Please enter \"throw\" (lowercase) to roll the die: ";
        cin >> commandToThrowDie;
    } while(commandToThrowDie != "throw");
    do{
        cout << "You rolled: " << userRoll << endl
             << "The Computer rolled: " << computerRoll << endl;
        if (userRoll < computerRoll){
            cout << "You lose. Try again? [Yes/No]: ";
         }
        if (computerRoll < userRoll){
            cout << "You win! Try again? [Yes/No]: ";
        }
        if (computerRoll == userRoll) {
            cout << "It's a draw. Try again? [Yes/No]: ";
        }
        cin >> yesOrNoChoice;
    } while(yesOrNoChoice != "Yes"); 
    system ("pause");
    return 0;
}
The problem is that after asking the user to enter a choice at the end of the do-while-loop the program exits loop no matter what I enter, instead of looping back to another throw of the die.
It ends up like this:

 
     
    