Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Classes/Blz/classes.blz
Normal file
16
Task/Classes/Blz/classes.blz
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# Constructors can take parameters (that automatically become properties)
|
||||
constructor Ball(color, radius)
|
||||
|
||||
# Objects can also have functions (closures)
|
||||
:volume
|
||||
return 4/3 * {pi} * (radius ** 3)
|
||||
end
|
||||
:show
|
||||
return "a " + color + " ball with radius " + radius
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
red_ball = Ball("red", 2)
|
||||
print(red_ball)
|
||||
# => a red ball with radius 2
|
||||
Loading…
Add table
Add a link
Reference in a new issue