added a snake game example and fixed a small bug in the compiler
This commit is contained in:
23
tests/with_else_if_shorthand.sl
Normal file
23
tests/with_else_if_shorthand.sl
Normal file
@@ -0,0 +1,23 @@
|
||||
import stdlib/stdlib.sl
|
||||
|
||||
word classify
|
||||
with n in
|
||||
n 0 < if
|
||||
"neg" puts
|
||||
else n 0 == if
|
||||
"zero" puts
|
||||
else n 10 < if
|
||||
"small" puts
|
||||
else
|
||||
"big" puts
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
word main
|
||||
-1 classify
|
||||
0 classify
|
||||
3 classify
|
||||
20 classify
|
||||
0
|
||||
end
|
||||
Reference in New Issue
Block a user