add example scripts for comments and loop
This commit is contained in:
parent
347191505d
commit
780962fcea
10
scripts/comments.rhai
Normal file
10
scripts/comments.rhai
Normal file
@ -0,0 +1,10 @@
|
||||
// I am a single line comment!
|
||||
|
||||
let /* I am a spy in a variable declaration! */ x = 5;
|
||||
|
||||
/* I am a simple
|
||||
multiline comment */
|
||||
|
||||
/* look /* at /* that, /* multiline */ comments */ can be */ nested */
|
||||
|
||||
/* sorrounded by */ x // comments
|
8
scripts/loop.rhai
Normal file
8
scripts/loop.rhai
Normal file
@ -0,0 +1,8 @@
|
||||
let x = 10;
|
||||
|
||||
// simulate do..while using loop
|
||||
loop {
|
||||
print(x);
|
||||
x = x - 1;
|
||||
if x <= 0 { break; }
|
||||
}
|
Loading…
Reference in New Issue
Block a user