title: Choose between 2 defined numbers randomly
body: <p>So I have this piece of code</p>
  
  <pre><code>if (x &gt;= gameView.getWidth()) { //if gone of the right side of screen
      x = x - gameView.getWidth(); //Reset x
      y = random.nextInt(gameView.getHeight());
      xSpeed = 
      ySpeed = 
  }
  </code></pre>
  
  <p>but I need to get both <code>xSpeed</code> and <code>ySpeed</code> to choose between two values, either '10' or '-10' and only those two numbers, nothing in between.</p>
  
  <p>Everywhere I've looked says use the <code>random.nextInt</code> but that also chooses from the numbers in between -10 and 10...</p>