title: Lua math.random not working
body: <p>So I'm trying to create a little something and I have looked all over the place looking for ways of generating a random number. However no matter where I test my code, it results in a non-random number. Here is an example I wrote up.</p>
  
  <pre><code>local lowdrops =  {"Wooden Sword","Wooden Bow","Ion Thruster Machine Gun Blaster"}
  local meddrops =  {}
  local highdrops = {}
  
  function randomLoot(lootCategory)
      if lootCategory == low then
          print(lowdrops[math.random(3)])
      end
      if lootCategory == medium then
  
      end
      if lootCategory == high then
  
      end
  end
  
  randomLoot(low)
  </code></pre>
  
  <p>Wherever I test my code I get the same result. For example when I test the code here <a href="http://www.lua.org/cgi-bin/demo">http://www.lua.org/cgi-bin/demo</a> it always ends up with the "Ion Thruster Machine Gun Blaster" and doesen't randomize. For that matter testing simply</p>
  
  <pre><code>random = math.random (10)
  print(random)
  </code></pre>
  
  <p>gives me 9, is there something i'm missing?</p>