title: C++ Simple Dice roll - how to return multiple different random numbers
body: <p>I am pretty new to C++ and am trying to make a simple die roll with a Die class/main.</p>
  
  <p>I can get a random number within my range 1-dieSize, however, each time I "roll the dice" it just gives me the same random number. For example, when I roll this dice three times, it will cout 111 or 222 etc instead of 3 different random rolls. Any help explaining this issue would be much appreciated!</p>
  
  <p>My die header is just a basic header. My issue I'm assuming is with the random function.</p>
  
  <p>main:</p>
  
  <pre><code>int main()
  {
  // Call menu to start the program
  Die myDie(4);
  
  cout &lt;&lt; myDie.rollDie();
  cout &lt;&lt; myDie.rollDie(); // roll dice again
  cout &lt;&lt; myDie.rollDie(); // roll again
  
  
  return 0;
  }
  </code></pre>
  
  <p>die.cpp:</p>
  
  <pre><code>Die::Die(int N)
  {
  //set dieSize to the value of int N
  this-&gt;dieSize = N;
  }
  
  int Die::rollDie()
  {
      // Declaration of variables
  int roll;
  int min = 1; // the min number a die can roll is 1
  int max = this-&gt;dieSize; // the max value is the die size
  
  unsigned seed;
  seed = time(0);
  srand(seed);
  
  roll = rand() % (max - min + 1) + min;
  
  return roll;
  }
  </code></pre>
  
  <p>In die.cpp I have the cstdlib and ctime included.</p>