mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-05 08:10:05 +00:00
26 lines
410 B
Plaintext
26 lines
410 B
Plaintext
class test
|
|
function __init(self, str)
|
|
self.hello = str
|
|
end
|
|
|
|
function print(self, i)
|
|
var str = self.hello
|
|
|
|
for (var x = i; x > 0; x=x-1) do
|
|
str = str .. "!"
|
|
end
|
|
|
|
print(str)
|
|
end
|
|
end
|
|
|
|
var obj = test("Hello world")
|
|
for (var i = 1; i <= 10; i=i+1) do
|
|
obj.print(i)
|
|
end
|
|
|
|
test.debug = function(self)
|
|
print("hi from " .. self)
|
|
end
|
|
|
|
obj.debug() |