Cosmo/examples/test.cosmo

26 lines
409 B
Plaintext
Raw Normal View History

class test
function __init(self, str)
self.hello = str
end
function print(self, i)
2020-11-12 05:10:53 +00:00
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 <= 1; i=i+1) do
obj.print(i)
end
test.debug = function(self)
print("hi from " .. self)
end
obj.debug()