aboutsummaryrefslogtreecommitdiff
path: root/examples/factorial.urm
diff options
context:
space:
mode:
Diffstat (limited to 'examples/factorial.urm')
-rw-r--r--examples/factorial.urm30
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/factorial.urm b/examples/factorial.urm
new file mode 100644
index 0000000..04d6e1d
--- /dev/null
+++ b/examples/factorial.urm
@@ -0,0 +1,30 @@
1ZERO 4
2JUMP 1 4 4
3ZERO 8
4JUMP 8 8 7
5Succ 1
6ZERO 9
7JUMP 9 9 29
8COPY 2 1
9ZERO 1
10Succ 1
11ZERO 3
12Succ 3
13COPY 6 1
14ZERO 1
15ZERO 5
16JUMP 3 5 25
17ZERO 7
18JUMP 6 7 22
19Succ 1
20Succ 7
21ZERO 10
22JUMP 10 10 17
23Succ 5
24ZERO 11
25JUMP 11 11 15
26JUMP 2 3 29
27Succ 3
28ZERO 12
29JUMP 12 12 12
30JUMP 1 1 30