This repository has been archived by the owner on Dec 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from SK1Y101/develop
Develop
- Loading branch information
Showing
7 changed files
with
163 additions
and
35 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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
{ | ||
"files": [ | ||
"README.md", | ||
"ExampleCode/README.md" | ||
"README.md" | ||
], | ||
"imageSize": 100, | ||
"commit": false, | ||
|
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
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,23 @@ | ||
///This section contains a small snippet of Skiylia | ||
code that demonstrates class methods and properties/// | ||
|
||
class Person: | ||
init(name, age): //executed on initialisation | ||
self.name = name | ||
self.age = age | ||
|
||
hello(): | ||
print("Hi there, I'm", self.name, ", and I'm", self.age) | ||
|
||
birthday(): | ||
self.age = self.age + 1 | ||
|
||
var John = Person("John", 24) | ||
John.hello() | ||
|
||
John.birthday() | ||
John.name = "Johnathon" | ||
John.hello() | ||
|
||
///Hi there, I'm John, and I'm 24 | ||
Hi there, I'm Johnathon, and I'm 25/// |
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,13 @@ | ||
///This section contains a small snippet of Skiylia | ||
code that calculates the factorial of a number/// | ||
def factorial(n): | ||
if int(n) != n: | ||
return null //can't compute factorial of a float this way | ||
if n < 2: | ||
return 1 | ||
return n * factorial(n - 1) //recursion that makes this work | ||
|
||
var num = 6 | ||
print("The factorial of", num, "is", factorial(num)) | ||
|
||
//output: The factorial of 6 is 720 |
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
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
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