aboutsummaryrefslogtreecommitdiff
path: root/example/example.imp
diff options
context:
space:
mode:
Diffstat (limited to 'example/example.imp')
-rw-r--r--example/example.imp19
1 files changed, 9 insertions, 10 deletions
diff --git a/example/example.imp b/example/example.imp
index b52d2da..a5bc5dd 100644
--- a/example/example.imp
+++ b/example/example.imp
@@ -1,13 +1,12 @@
-y := 0;
-
-var x := 5 in
-
- while x < 10 and true do
- x := (x + 1);
+procedure factorial(n;r) begin
+ if n <= 0 then
+ r := 1;
+ else
+ m := n - 1;
+ factorial(m;r);
+ r := r * n;
end;
-
- y := x;
-
end;
-z := 5; \ No newline at end of file
+n := 5;
+factorial(n;r); \ No newline at end of file