this is what i have come up with but it doesnt work it asks for the first input to total then it just says press any key to continue what am i doing wrong?
Code:
#include <iostream>
#include <stdlib.h>
using namespace std;
int main(){
int total, again, n1, y = 1, n = 2;
cout << "Welcome to Hell. Wanna play?" << endl;
cout << " Pick a number any number I can handle it." << endl;
cin >> total;
while ( again == 1){
while (total < 1) {
cout << " need a number greater then 0" << endl;
cin >> total;
}
while(total > 0) {
if ((total % 3) == 2){
total = total - 2;
cout << "I'll take 2 whether you like it or not. =P" << endl;
} else {
total--;
cout << " I'm taking one mo ........a." << endl;
}
cout << " Only " << total << " left. Can you even count that high?" << endl;
if (total == 0) {
cout << " HAHAHA I WIN I WIN I WIN !!!!!!!!!!!!!!!!" << endl;
break;
}
cout << "Pick a 1 or 2 I promise it doesn't matter though I'll still win ";
cin >> n1;
while (n1 < 1 || n1 > 2){
cout << "Hey I thought I told you 1 or 2 try again numskull " << endl;
cin >> n1;
}
total = total - n1;
cout << " Okay we are at " << total << " Good job you made me do the math for you now lets move on" << endl;
if (total == 0) {
cout << " Wow whats a shocker you won. Good job you beat something that can't even think on its own" << endl;
break;
}
}
cout << " wanna go again? y/n" <<endl;
cin >> again;
}
system ("PAUSE");
return 0;
}