added an option to redefine control structures
This commit is contained in:
36
tests/custom_control_structures.sl
Normal file
36
tests/custom_control_structures.sl
Normal file
@@ -0,0 +1,36 @@
|
||||
import stdlib/stdlib.sl
|
||||
import stdlib/control.sl
|
||||
|
||||
word main
|
||||
1 if
|
||||
11 puti cr
|
||||
else
|
||||
99 puti cr
|
||||
end
|
||||
|
||||
0 if
|
||||
99 puti cr
|
||||
else
|
||||
22 puti cr
|
||||
end
|
||||
|
||||
0 if
|
||||
500 puti cr
|
||||
else 1 if
|
||||
33 puti cr
|
||||
else
|
||||
44 puti cr
|
||||
end
|
||||
|
||||
0
|
||||
5 for
|
||||
1 +
|
||||
end
|
||||
puti cr
|
||||
|
||||
0
|
||||
while dup 3 < do
|
||||
1 +
|
||||
end
|
||||
puti cr
|
||||
end
|
||||
Reference in New Issue
Block a user