aboutsummaryrefslogtreecommitdiff
path: root/test.pr
diff options
context:
space:
mode:
authorNat Lasseter <Nat Lasseter user@4574.co.uk>2018-02-15 14:50:59 +0000
committerNat Lasseter <Nat Lasseter user@4574.co.uk>2018-02-15 14:50:59 +0000
commitbfed3dfba46a3f39389bdb529e021e266128df67 (patch)
treee624950a22a25c66b3ef83c9f2af99d6aac3e616 /test.pr
Initial Commit
Diffstat (limited to 'test.pr')
-rw-r--r--test.pr37
1 files changed, 37 insertions, 0 deletions
diff --git a/test.pr b/test.pr
new file mode 100644
index 0000000..77dfb27
--- /dev/null
+++ b/test.pr
@@ -0,0 +1,37 @@
+zerop(0) is
+ true
+end
+zerop(_) is
+ false
+end
+
+fib(0) is
+ 1
+end
+fib(1) is
+ 1
+end
+fib(x) is
+ fib(x-1) + fib(x-2)
+end
+
+add(x, y) is
+ x + y
+end
+
+puts add(1, 2)
+puts fib(5)
+
+putser(string) is
+ puts string
+end
+putser("foo")
+
+varity(_) is
+ puts "one thing"
+end
+varity(_, _) is
+ puts "two things"
+end
+varity(1)
+varity(1,2)