mirror of
https://github.com/CPunch/Cosmo.git
synced 2025-10-21 00:10:18 +00:00
moved examples to examples folder
This commit is contained in:
26
examples/test.cosmo
Normal file
26
examples/test.cosmo
Normal file
@@ -0,0 +1,26 @@
|
||||
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 <= 1; i=i+1) do
|
||||
obj.print(i)
|
||||
end
|
||||
|
||||
test.debug = function(self)
|
||||
print("hi from " .. self)
|
||||
end
|
||||
|
||||
obj.debug()
|
Reference in New Issue
Block a user