Add new example scripts.

This commit is contained in:
Stephen Chung
2021-06-07 20:15:06 +08:00
parent c4b3ad7c7b
commit bed5256e2e
4 changed files with 35 additions and 2 deletions

10
scripts/if2.rhai Normal file
View File

@@ -0,0 +1,10 @@
let a = 42;
let b = 123;
let x = if a <= b { // if-expression
b - a
} else {
a - b
} * 10;
print(`x should be 810: ${x}`);