tasks a-s

This commit is contained in:
Ingy döt Net 2013-04-10 23:57:08 -07:00
parent 47bf37c096
commit b83f433714
12433 changed files with 156208 additions and 123 deletions

View file

@ -0,0 +1,29 @@
-- Point
local Point = {x = 0, y = 0}
function Point:new(o)
o = o or {}
setmetatable(o, self)
self.__index = self
return o
end
function Point:print()
print("Point(" .. self.x .. ", " .. self.y .. ")")
end
function Point:copy()
return Point:new{x = self.x, y = self.y}
end
-- Circle
local Circle = Point:new()
Circle.r = 0
function Circle:print()
print("Circle(" .. self.x .. ", " .. self.y .. ", " .. self.r .. ")")
end
function Circle:copy()
return Circle:new{x = self.x, y = self.y, r = self.r}
end