Implement functions, arrays, maps, and while loops. Document and clean up code.
This commit is contained in:
@@ -28,4 +28,36 @@ if (bool "true") {
|
||||
This is a multiline comment
|
||||
###
|
||||
|
||||
# This is a single line comment
|
||||
# This is a single line comment
|
||||
|
||||
set hi to ["testovich", 3]
|
||||
|
||||
set hi[0] to "testo"
|
||||
|
||||
print $hi[0]
|
||||
|
||||
set hi to (append $hi with items [5, 4])
|
||||
|
||||
print {$hi[2] + $hi[3]}
|
||||
|
||||
set msi to [5: "hi", "hello": "world"]
|
||||
set msi[5] to "hello"
|
||||
print $msi[5]
|
||||
print $msi["hello"]
|
||||
|
||||
set c to 0
|
||||
set f to true
|
||||
loop while $f {
|
||||
set c to {$c + 1}
|
||||
if {$c == 3} {
|
||||
set f to false
|
||||
}
|
||||
print {"iter: " + (str $c)}
|
||||
}
|
||||
|
||||
define hi {
|
||||
print {"Hello, " + $_args[""]}
|
||||
}
|
||||
|
||||
hi "Function"
|
||||
hi "World"
|
||||
Reference in New Issue
Block a user