Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
11
Task/Inheritance-Multiple/Lingo/inheritance-multiple-1.lingo
Normal file
11
Task/Inheritance-Multiple/Lingo/inheritance-multiple-1.lingo
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
-- parent script "Camera"
|
||||
property resolution
|
||||
|
||||
on new (me)
|
||||
me.resolution = "1024x768"
|
||||
return me
|
||||
end
|
||||
|
||||
on snap (me)
|
||||
put "SNAP!"
|
||||
end
|
||||
13
Task/Inheritance-Multiple/Lingo/inheritance-multiple-2.lingo
Normal file
13
Task/Inheritance-Multiple/Lingo/inheritance-multiple-2.lingo
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
-- parent script "MobilePhone"
|
||||
property ringtone
|
||||
|
||||
on new (me)
|
||||
me.ringtone = "Bell"
|
||||
return me
|
||||
end
|
||||
|
||||
on ring (me, n)
|
||||
repeat with i = 1 to n
|
||||
put "RING!!!"
|
||||
end repeat
|
||||
end
|
||||
15
Task/Inheritance-Multiple/Lingo/inheritance-multiple-3.lingo
Normal file
15
Task/Inheritance-Multiple/Lingo/inheritance-multiple-3.lingo
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
-- parent script "CameraPhone"
|
||||
property ancestor
|
||||
|
||||
on new (me)
|
||||
c = script("Camera").new()
|
||||
mp = script("MobilePhone").new()
|
||||
|
||||
-- make the Camera instance a parent of the MobilePhone instance
|
||||
mp.setProp(#ancestor, c)
|
||||
|
||||
-- make the MobilePhone instance a parent of this CameraPhone instance
|
||||
me.ancestor = mp
|
||||
|
||||
return me
|
||||
end
|
||||
15
Task/Inheritance-Multiple/Lingo/inheritance-multiple-4.lingo
Normal file
15
Task/Inheritance-Multiple/Lingo/inheritance-multiple-4.lingo
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
cp = script("CameraPhone").new()
|
||||
|
||||
cp.snap()
|
||||
-- "SNAP!"
|
||||
|
||||
cp.ring(3)
|
||||
-- "RING!!!"
|
||||
-- "RING!!!"
|
||||
-- "RING!!!"
|
||||
|
||||
put cp.resolution
|
||||
-- "1024x768"
|
||||
|
||||
put cp.ringtone
|
||||
-- "Bell"
|
||||
Loading…
Add table
Add a link
Reference in a new issue