2020-11-10 01:44:12 +00:00
|
|
|
class test
|
|
|
|
function __init(self, str)
|
|
|
|
self.hello = str
|
|
|
|
end
|
2020-11-04 04:18:55 +00:00
|
|
|
|
2020-11-10 01:44:12 +00:00
|
|
|
function print(self, i)
|
2020-11-12 05:10:53 +00:00
|
|
|
var str = self.hello
|
2020-11-10 01:44:12 +00:00
|
|
|
|
|
|
|
for (var x = i; x > 0; x=x-1) do
|
|
|
|
str = str .. "!"
|
|
|
|
end
|
|
|
|
|
|
|
|
print(str)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
var obj = test("Hello world")
|
2020-11-13 23:39:47 +00:00
|
|
|
for (var i = 1; i <= 1; i=i+1) do
|
2020-11-10 01:44:12 +00:00
|
|
|
obj.print(i)
|
|
|
|
end
|
|
|
|
|
|
|
|
test.debug = function(self)
|
|
|
|
print("hi from " .. self)
|
2020-11-04 04:18:55 +00:00
|
|
|
end
|
|
|
|
|
2020-11-10 01:44:12 +00:00
|
|
|
obj.debug()
|