mirror of
https://github.com/ProgramSnail/Lama.git
synced 2026-01-05 21:48:14 +00:00
Added x86only
This commit is contained in:
parent
2bf7ab7091
commit
584e7a998b
5 changed files with 46 additions and 0 deletions
19
regression/x86only/test001.expr
Normal file
19
regression/x86only/test001.expr
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
fun insert (tree, value) {
|
||||
case tree of
|
||||
`Empty -> return `Node (value, `Empty, `Empty)
|
||||
| `Node (x, left, right) ->
|
||||
if x > value
|
||||
then return `Node (x, insert (left, value), right)
|
||||
else return `Node (x, left, insert (right, value))
|
||||
fi
|
||||
esac
|
||||
}
|
||||
|
||||
tree := `Empty;
|
||||
|
||||
for i := 0, i <= 10, i := i+1 do
|
||||
printf ("%s\n", tree.string);
|
||||
tree := insert (tree, i)
|
||||
od;
|
||||
|
||||
printf ("%s\n", tree.string)
|
||||
Loading…
Add table
Add a link
Reference in a new issue