#include <iostream>
#include <cstdlib>
#include <ctime>
#include <string>
usingnamespace std;
int main ()
{
int max, black;
string death;
cout<< "Welcome to the dice rolling game\n";
cout<< "\n";
cout<< "Simply type /roll to play\n";
cout<< "\n";
cin>> death;
srand (time (0));
black = rand () % 20 ;max;
if (death == "/roll")
{
cout<<"\n";
cout<<"\n";
cout<< "You rolled a " << black << endl;
cout<<"\n";
}
if (black < 10)
{
cout<<"\n";
cout<<"\n";
cout<<" Your warrior advances through the forest.\n";
}
else;
{
cout<<"\n";
cout<<"\n";
cout<<" Your warrior has encountered three Skeletal Warriors.\n";
}
cin.ignore();
cin.get();
}
Everytime I run this program and I roll lower than a 10 instead of just the one statement appearing, both of them appear.
Any hints of help you guys could give me?