Implement 2.1

This commit is contained in:
2020-10-19 21:36:17 -04:00
parent 32b723deee
commit 1a8a806f35
2 changed files with 68 additions and 0 deletions

13
util.scm Normal file
View File

@@ -0,0 +1,13 @@
(define (assert a b)
(cond ((equal? a b) (display "[ok]"))
(else
(display "[error] ")
(display a)
(display " != ")
(display b)))
(newline))
(define (gcd a b)
(if (= b 0) (abs a) (gcd b (remainder a b))))
;(assert (gcd 93 15) 3)