title: 2D Arrays in LUA not possible in loop?
body: <p>For some reason I've been stuck on this problem for ages. I can't work out how to define grid[i] without resetting all of it's values. I want to make it so the program checks to see if the point in the 2D array is already occupied then it wont place a block.</p>
  
  <pre><code>radius = 10
  
  grid = {}
  
  while true do
      for i = -radius,radius do
          grid[i] = {}
          for j = -radius,radius do
              if math.sqrt(math.pow(i,2)+math.pow(j,2))&lt;radius and (not grid[i][j] or grid[i][j] == 0) then
                  print("Placing..")
              else
                  part:Destroy()
                  grid[i][j] = 0
              end
          end
      end
  end
  </code></pre>