mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Updated README.md
This commit is contained in:
16
README.md
16
README.md
@@ -1,7 +1,7 @@
|
|||||||
*For the feature complete version 1, [click here](https://github.com/Ratstail91/Toy/tree/v1).*
|
*For the feature complete version 1, [click here](https://github.com/Ratstail91/Toy/tree/v1).*
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<image src="toylogo.png" />
|
<image src="toylogo.png" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
# Toy v2.x
|
# Toy v2.x
|
||||||
@@ -34,7 +34,7 @@ var foobar = 42;
|
|||||||
|
|
||||||
//scopes allow for shadowing and rebinding
|
//scopes allow for shadowing and rebinding
|
||||||
{
|
{
|
||||||
var foobar = foobar * 7;
|
var foobar = foobar * 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
//the types default to 'any' but can be specified if needed (same with constants)
|
//the types default to 'any' but can be specified if needed (same with constants)
|
||||||
@@ -43,6 +43,18 @@ var immutable: string const = "Foobar";
|
|||||||
//the assert keyword can check an expression, and takes an optional second parameter
|
//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";
|
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
|
//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