title: How to use a random number generator to determine path in "if" statement
body: <p>I'm trying to use a random number to determine if an event will happen using an <code>if</code> statement.</p>
  
  <p>I keep getting the following error:</p>
  
  <pre><code> lunarlander.rb:13: syntax error, unexpected '='
      if (numb % = 2)*
  </code></pre>
  
  <p>Here is the code:</p>
  
  <pre><code>def space_travel
      puts "\n"
      puts "You engage the main thrusters and you feel the ship jerk forward."
      numb = rand(10)
      if (numb % == 2)
          puts "Everything functions as expected. You settle in for the trip."
      else
          spacewalk()
      end
  end
  </code></pre>