Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
2
Task/Classes/Ring/classes-1.ring
Normal file
2
Task/Classes/Ring/classes-1.ring
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
New point { x=10 y=20 z=30 print() }
|
||||
Class Point x y z func print see x + nl + y + nl + z + nl
|
||||
15
Task/Classes/Ring/classes-2.ring
Normal file
15
Task/Classes/Ring/classes-2.ring
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
New point # create new object using the point class
|
||||
{ # access the new object attributes and methods
|
||||
x = 10 # set the x attribute to 10
|
||||
y = 20 # set the y attribute to 20
|
||||
z = 30 # set the z attribute to 30
|
||||
print() # call the print method
|
||||
} # end of object access
|
||||
|
||||
|
||||
Class Point # define the Point class
|
||||
x y z # the class contains three attributes x, y & z
|
||||
func print # define the print method
|
||||
see x + nl + # print the x attribute
|
||||
y + nl + # print the y attribute
|
||||
z + nl # print the z attribute
|
||||
Loading…
Add table
Add a link
Reference in a new issue