Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. if matrix[x] and matrix[x][y] then
  2. -- Делаем что-то с этим элементом
  3. end
  4.  
  5. setmetatable(matrix, {
  6. __call = function(self, x, y)
  7. result = self[x] == nil
  8. if result
  9. then
  10. return result
  11. else
  12. return self[x][y]
  13. end
  14. end,
  15. })
  16.  
  17. content = matrix(x, y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement