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
5
Task/Inheritance-Single/Coco/inheritance-single-1.coco
Normal file
5
Task/Inheritance-Single/Coco/inheritance-single-1.coco
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class Animal
|
||||
class Cat extends Animal
|
||||
class Dog extends Animal
|
||||
class Lab extends Dog
|
||||
class Collie extends Dog
|
||||
28
Task/Inheritance-Single/Coco/inheritance-single-2.coco
Normal file
28
Task/Inheritance-Single/Coco/inheritance-single-2.coco
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
class Animal
|
||||
|
||||
(@name) ->
|
||||
|
||||
move: (meters) ->
|
||||
alert @name + " moved #{meters}m."
|
||||
|
||||
class Snake extends Animal
|
||||
|
||||
-> super ...
|
||||
|
||||
move: ->
|
||||
alert 'Slithering...'
|
||||
super 5
|
||||
|
||||
class Horse extends Animal
|
||||
|
||||
-> super ...
|
||||
|
||||
move: ->
|
||||
alert 'Galloping...'
|
||||
super 45
|
||||
|
||||
sam = new Snake 'Sammy the Python'
|
||||
tom = new Horse 'Tommy the Palomino'
|
||||
|
||||
sam.move!
|
||||
tom.move!
|
||||
Loading…
Add table
Add a link
Reference in a new issue