title: Generate two different random numbers
body: <p>I'm going to create a simple "Craps" game using C++</p>
  
  <p>In "Craps", when player throw the dice is not some point that immediatly win or lose, they need to throw it again</p>
  
  <p>But I can't change the dice number when it need to throw again</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstdlib&gt;
  #include &lt;ctime&gt;
  
  using namespace std;
  
  void again(int first) {
      srand(time(NULL));
      int dice11, dice22, total2;
      do {
          dice11 = (rand() % 6 + 1);
          dice22 = (rand() % 6 + 1);
          total2 = dice11 + dice22;
          cout &lt;&lt; "Player throw " &lt;&lt; total2 &lt;&lt; endl;
          if (total2 == first)
              cout &lt;&lt; "Player Win" &lt;&lt; endl;
          if (total2 == 7)
              cout &lt;&lt; "Player Lose" &lt;&lt; endl;
      } while (total2 != first);
  
  }
  
  
  
  int main() {
      srand(time(NULL));
      int dice1, dice2,total;
          dice1 = (rand() % 6 + 1);
          dice2 = (rand() % 6 + 1);
          total = dice1 + dice2;
  
          if (total == 7 || total == 11)
              cout &lt;&lt; "Player throw " &lt;&lt; total &lt;&lt; " Player Win" &lt;&lt; endl;
          else
              if (total == 2 || total == 8 || total == 12)
                  cout &lt;&lt; "Player throw " &lt;&lt; total &lt;&lt; " Player Lose" &lt;&lt; endl;
              else
              {   
                  cout &lt;&lt; "Player throw " &lt;&lt; total &lt;&lt; endl;
                  again(total);
              }
  
  
      system("pause");
      return 0;
  }
  </code></pre>
  
  <p>In program, I already create a function that use "srand()" again, but it still not work</p>