-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class Breakfast { | ||
cook() { | ||
print "Eggs a-fryin'!"; | ||
} | ||
|
||
serve(who) { | ||
print "Enjoy your breakfast, " + who + "."; | ||
} | ||
} | ||
|
||
var someVariable = Breakfast(); | ||
someVariable.serve("arc"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class Doughnut { | ||
cook() { | ||
print "Fry until golden brown."; | ||
} | ||
} | ||
|
||
class BostonCream < Doughnut {} | ||
|
||
~ cook() method is inherited from `Doughnut` to 'BostonCream' | ||
|
||
BostonCream().cook(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
~ First arc program | ||
print "Hello, world!"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
fn returnFunction() { | ||
var outside = "outside"; | ||
|
||
fn inner() { | ||
print outside; | ||
} | ||
|
||
return inner; | ||
} | ||
|
||
var fun = returnFunction(); | ||
fun(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class Doughnut { | ||
cook() { | ||
print "Fry until golden brown."; | ||
} | ||
} | ||
|
||
class BostonCream < Doughnut { | ||
cook() { | ||
super.cook(); | ||
print "Pipe full of custard and coat with chocolate."; | ||
} | ||
} | ||
|
||
~ super.cook() calls cook() method in superclass 'Doughnut' | ||
|
||
BostonCream().cook(); |