Advertisement
Guest User

Untitled

a guest
Jul 24th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.30 KB | None | 0 0
  1. function getCellsInRectangle(topLeft, bottomLeft)
  2.     --topLeft -> cell in top left of rectangle
  3.     --bottomLeft -> cell in bottom left of rectangle
  4.     local cells = {}
  5.     for x = topLeft.X, bottomLeft.X do
  6.         for y = topLeft.Y, bottomLeft.Y do
  7.             cells[#cells + 1] = CPos.New(x, y)
  8.         end
  9.     end
  10.     return cells
  11. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement