-
Notifications
You must be signed in to change notification settings - Fork 2
Syntax
Brian edited this page Nov 1, 2024
·
2 revisions
class Base
vars id
method showid()
vars x
begin
self.id = 10
x = self.id
io.print(x)
x = 0
return x
end-method
end-class
class Person
vars num
method calc(x)
vars y, z
begin
z = self.num
y = x + z
io.print(y)
y = new Base
return y
end-method
end-class
main()
vars p, b, x
begin
b = new Base
p = new Person
p._prototype = b
b.id = 111
p.num = 123
p.id = 321
x = 1024
p.showid()
p.calc(x)
endMade by Arthur Trindade + Brian Matheus + Isabella Machado with ❤️.