title: Using Random.range to generate level no without repetition
body: <p>I tried to use recursion for the problem at hand as follows,</p>
  
  <pre><code>int newlevelgen()
  {
      int exampleno = Random.Range (1,4);
      if (exampleno != lastlevelno)
      {
          lastlevelno = exampleno;
          return exampleno;
      }
      else
      {
          newlevelgen();
      }
      return exampleno;
  }
  </code></pre>
  
  <p>This is my code above, what I want to do is generate new number without repeating the previous one, but this simply does not work. Help!</p>