Rock-Paper-Scissors-Lizard-Spock C++ Pogram I'm writing the C++ program that involves a twist on Rock, Paper, Scissors. How the added Lizard and Spock affect the game is very simple and you could look it up if you want, but its not needed as I'm 99% sure my issue lies with the formatting of my if-else statements.
In every iteration, no matter what configuration the computer or the user chooses, the outcome is always the same - i.e. &quot;You win! :)&quot;. Even in the cases where the user should have tied, or the user should have lost. If you are experienced, you will probably very easily see where I am messing up, please take a look. I apologize for the confusing curly braces but inputting my code was being very finnicky so I had to add random indents to make it format.
#include &lt;iostream&gt;
int main(){

srand(time(NULL));
int computer = rand() % 5 + 1;

int user = 0;

std::cout &lt;&lt; &quot;=============================================\n&quot;;
std::cout &lt;&lt; &quot;Rock    Paper    Scissors    Spock    Lizard!\n&quot;;
std::cout &lt;&lt; &quot;=============================================\n&quot;;
std::cout &lt;&lt; &quot;1) Rock\n&quot;;
std::cout &lt;&lt; &quot;2) Paper\n&quot;;
std::cout &lt;&lt; &quot;3) Scissors\n&quot;;
std::cout &lt;&lt; &quot;4) Lizard\n&quot;;
std::cout &lt;&lt; &quot;5) Spock\n&quot;;
std::cout &lt;&lt; &quot;\n&quot;;
std::cout &lt;&lt; &quot;Shoot!\n&quot;;

std::cin &gt;&gt; user;
std::cout &lt;&lt; &quot;Computer chose: &quot; &lt;&lt; computer &lt;&lt; &quot;\n&quot;;

if(user == 1){
if(computer == 3 || 4){
  std::cout &lt;&lt; &quot;You win! :)\n&quot;;
}
else if(computer == 1){
  std::cout &lt;&lt; &quot;You tied! :/\n&quot;;
}
else{
  std::cout &lt;&lt; &quot;Computer wins! :(\n&quot;;
}
    } 
else if(user == 2){
if(computer == 1 || 5){
  std::cout &lt;&lt; &quot;You win! :)\n&quot;;
}
else if(computer == 2){
  std::cout &lt;&lt; &quot;You tied! :/\n&quot;;
}
else{
  std::cout &lt;&lt; &quot;Computer wins! :(\n&quot;;
} 
 }
else if(user == 3){
if(computer == 2 || 4){
  std::cout &lt;&lt; &quot;You win! :)\n&quot;;
}
else if(computer == 3){
  std::cout &lt;&lt; &quot;You tied! :/\n&quot;;
}
else{
  std::cout &lt;&lt; &quot;Computer wins! :(\n&quot;;
}    
}
else if(user == 4){
if(computer == 2 || 5){
  std::cout &lt;&lt; &quot;You win! :)\n&quot;;
}
else if(computer == 4){
  std::cout &lt;&lt; &quot;You tied! :/\n&quot;;
}
else{
  std::cout &lt;&lt; &quot;Computer wins! :(\n&quot;;
} 
  }
else{
if(computer == 1 || 3){
  std::cout &lt;&lt; &quot;You win! :)\n&quot;;
}
else if(computer == 5){
  std::cout &lt;&lt; &quot;You tied! :/\n&quot;;
}
else{
  std::cout &lt;&lt; &quot;Computer wins! :(\n&quot;;
}
 }
  }
Spacing
Before anything, I would recommend fixing your spacing and tabbing. Four spaces for each level of nesting is recommended. It makes your code a lot more readable.
Bug
There is a pretty obvious bug in your code I noticed on my first pass. It's how you're checking the computers number versus the users number. For instance, take a look at this line:
if (user == 0 || 1)

To a novice, it looks like if user == 0 OR user == 1, but that is not happening here. Instead, this is only checking if user is equal to 0, OR if 1 is true. And 1 is always true. This can result in some unexpected behavior. Take a look:
if (user == 0 || 1) { 
    std::cout &lt;&lt; &quot;Greetings!&quot; &lt;&lt; std::endl; 
} else {
    std::cout &lt;&lt; &quot;Hello!&quot; &lt;&lt; std::endl;
}

Now, if I only enter 0, I will get the expected output of just &quot;Greetings!&quot;. However, if I enter literally any other number, I will instead only get &quot;Greetings!&quot;, instead of getting &quot;Hello!&quot;.
Repetition
You have tons of repeated code. You can simplify this by first checking for if the computers input is the same as the users at the start of the program. Then you won't have to keep checking on the goat if/else chunk.
if (computer == user) {
    std::cout &lt;&lt; &quot;You tied! :/&quot; &lt;&lt; std::endl;
    return 0;
}

Then, you can just assume the user loses at the start.
std::string message = &quot;Computer wins! :(&quot;;

Now, you only have to check for win conditions, and if any are met, you change the message variable.
if (
    (user == 1 &amp;&amp; (computer == 3 || computer == 4)) ||
    (user == 2 &amp;&amp; (computer == 1 || computer == 5)) ||
    (user == 3 &amp;&amp; (computer == 2 || computer == 4)) ||
    (user == 4 &amp;&amp; (computer == 2 || computer == 5)) ||
    (user == 5 &amp;&amp; (computer == 1 || computer == 3))
) message = &quot;You win! :)&quot;;

Then, you just output the message variable.
std::cout &lt;&lt; message &lt;&lt; std::endl;

End
All in all, with these changes made your code now looks like this:
#include &lt;iostream&gt;

int main() {

    srand(time(NULL));
    int computer = rand() % 5 + 1;
    int user = 0;

    std::cout &lt;&lt; &quot;=============================================\n&quot;;
    std::cout &lt;&lt; &quot;Rock    Paper    Scissors    Spock    Lizard!\n&quot;;
    std::cout &lt;&lt; &quot;=============================================\n&quot;;
    std::cout &lt;&lt; &quot;1) Rock\n&quot;;
    std::cout &lt;&lt; &quot;2) Paper\n&quot;;
    std::cout &lt;&lt; &quot;3) Scissors\n&quot;;
    std::cout &lt;&lt; &quot;4) Lizard\n&quot;;
    std::cout &lt;&lt; &quot;5) Spock\n&quot;;
    std::cout &lt;&lt; &quot;\n&quot;;
    std::cout &lt;&lt; &quot;Shoot!\n&quot;;

    std::cin &gt;&gt; user;
    std::cout &lt;&lt; &quot;Computer chose: &quot; &lt;&lt; computer &lt;&lt; &quot;\n&quot;;

    if (computer == user) {
        std::cout &lt;&lt; &quot;You tied! :/&quot; &lt;&lt; std::endl;
        return 0;
    }

    std::string message = &quot;Computer wins! :(&quot;;

    if (
        (user == 1 &amp;&amp; (computer == 3 || computer == 4)) ||
        (user == 2 &amp;&amp; (computer == 1 || computer == 5)) ||
        (user == 3 &amp;&amp; (computer == 2 || computer == 4)) ||
        (user == 4 &amp;&amp; (computer == 2 || computer == 5)) ||
        (user == 5 &amp;&amp; (computer == 1 || computer == 3))
    ) message = &quot;You win! :)&quot;;

    std::cout &lt;&lt; message &lt;&lt; std::endl;

    return 0;
}