Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
22
Task/Classes/Pluto/classes.pluto
Normal file
22
Task/Classes/Pluto/classes.pluto
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
class bear
|
||||
-- Constructs a Bear instance passing it a name
|
||||
-- which is stored in a private field to avoid external mutation.
|
||||
function __construct(private name) end
|
||||
|
||||
-- Property to get the name
|
||||
function name() return self.name end
|
||||
|
||||
-- Method to make a noise.
|
||||
function make_noise()
|
||||
print("Growl!")
|
||||
end
|
||||
end
|
||||
|
||||
-- Create a new bear instance and assign a reference to it
|
||||
-- to the variable b.
|
||||
local b = new bear("Bruno")
|
||||
|
||||
-- Print the bear's name.
|
||||
print($"The bear is called {b:name()}.")
|
||||
-- Make a noise.
|
||||
b:make_noise()
|
||||
Loading…
Add table
Add a link
Reference in a new issue