title: C++ Using rand with if statement
body: <p>I started C++ literally one day ago and I've been having a problem trying to create a rock, paper, scissors game. This code is not exactly how it will look when it's done, but I made this to demonstrate my issue.</p>
  
  <p>I've made brps, meaning: bot rock paper scissors, a random number from 1-3 where the corresponding number will result in a cout stating what item the bot chose.</p>
  
  <p>The rand part of the code was made from viewing different forums and answers to previous questions, but I can't seem to get this to work out. Whenever I run the program it says "Bot chose <strong>the rock</strong>" no matter what I do. However if I remove the if statemets, and simply print <strong>brps</strong> it shows a random number each time. So I need help to figure out why the program chooses the rock every single time when that choice should be defined by what number rand chooses.</p>
  
  <p>Feel free to comment on other parts of the code as well, since I'm expecting it all to be somewhat poorly written :L</p>
  
  <p>EDIT: urps is where the user inputs an answer. I didn't use it in this example.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;time.h&gt;
  
  using namespace std;
  
  int main()
  {
      cout&lt;&lt;"Hi! Welcome to ROCK PAPER SCISSORS!\n";
      cout&lt;&lt;"To play, press enter.\n";
      cin.get();
      system("cls");
  
  int game();
  {
      srand(time(NULL));
      int brps = rand()&gt;&gt;4, urps;
      brps = brps % 3 + 1;
  
  
  cout&lt;&lt;"Bot chose ";
  if (brps = 1){
      cout&lt;&lt;"the rock.\n";}
  
  else if (brps = 2){
      cout&lt;&lt;"the paper.\n"; }
  
  else if (brps = 3){
      cout&lt;&lt;"the scissors.\n"; }
  
  else{
      cout&lt;&lt;"invalid.\n.";}
  
  cin.get(); 
  }
  
  }
  </code></pre>