mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Updated README.md
This commit is contained in:
12
README.md
12
README.md
@@ -43,6 +43,18 @@ var immutable: string const = "Foobar";
|
||||
//the assert keyword can check an expression, and takes an optional second parameter
|
||||
assert immutable == "Fizzbuzz", "This message is sent to the terminal by default";
|
||||
|
||||
//if and while works
|
||||
var count = 1;
|
||||
while (count <= 10) {
|
||||
if (count % 2 == 0) {
|
||||
print "even";
|
||||
}
|
||||
else {
|
||||
print "odd";
|
||||
}
|
||||
count += 1;
|
||||
}
|
||||
|
||||
//NOTE: This section will be expanded as more features are implemented
|
||||
```
|
||||
|
||||
|
||||
11
scripts/count.toy
Normal file
11
scripts/count.toy
Normal file
@@ -0,0 +1,11 @@
|
||||
//if and while works
|
||||
var count = 1;
|
||||
while (count <= 10) {
|
||||
if (count % 2 == 0) {
|
||||
print "even";
|
||||
}
|
||||
else {
|
||||
print "odd";
|
||||
}
|
||||
count += 1;
|
||||
}
|
||||
Reference in New Issue
Block a user