Hi,
I’m trying to make the rock paper scissors game and i got the wrong output for my code and can’t figure out why.
my code: > srand (time(NULL));
int computer = rand() % 3 + 1;
int user = 0;
std::cout << “====================\n”;
std::cout << “rock paper scissors!\n”;
std::cout << “====================\n”;std::cout << “1)
\n”;
std::cout << “2)\n”;
std::cout << “3)\n”;
std::cout << "shoot! ";
std::cin >> user;
if (computer == 1 && user == 1) { std::cout << "Rock vs Rock, Draw!\n"; } else (computer == 1 && user == 2); { std::cout << "Paper beats rock, you win!\n"; }
and my output:
can anyone see from this what’s wrong?