summaryrefslogtreecommitdiffstats
path: root/examples/even-odd.scm
diff options
context:
space:
mode:
Diffstat (limited to 'examples/even-odd.scm')
-rw-r--r--examples/even-odd.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/even-odd.scm b/examples/even-odd.scm
new file mode 100644
index 0000000..e2ef631
--- /dev/null
+++ b/examples/even-odd.scm
@@ -0,0 +1,6 @@
+(define (even? x)
+ (if (= x 0) #t (odd? (- x 1))))
+(define (odd? x)
+ (if (= x 1) #t (even? (- x 1))))
+
+(display (even? 99))