Initial commit

This commit is contained in:
Alexey 2025-05-20 02:51:17 +03:00
commit f765ec74ef
6 changed files with 181 additions and 0 deletions

24
point.lua Normal file
View file

@ -0,0 +1,24 @@
-- Point table
Point = {}
-- Factory function
function Point:new( x, y )
local point = {
x = x or 1,
y = y or 1
}
setmetatable( point, { __index = self } )
return point
end
-- Comparing function
function Point:equals( point )
return self.x == point.x and self.y == point.y
end
-- Get self coordinates
function Point:coords()
return self.x, self.y
end