Add new example scripts.
This commit is contained in:
10
scripts/if2.rhai
Normal file
10
scripts/if2.rhai
Normal 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}`);
|
Reference in New Issue
Block a user