a-conjecture-of-mine

An exercise on polyglossy: the same problem solved on multiple languages

commit c7b51a4bfe125e03fc7371e24a1da56568acb925
parent f00a25dbba8a5949c25ded19c8df75f874e91076
Author: Pablo Escobar Gaviria <gark.garcia@protonmail.com>
Date:   Sat,  1 Feb 2020 22:48:15 -0200

Formatted the Racket implementation.

Diffstat:
Mscript.rkt | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/script.rkt b/script.rkt
@@ -24,12 +24,12 @@
     (let ([sum (lambda (n) (vector-ref sums-cache n))])
          (zero? (remainder (- (sum (+ a b)) (sum a) (sum b)) 9))))
 
-(define (sum-digits n) (sum-digits-tail n 0))
-
-(define (sum-digits-tail n acc)
-    (if (zero? n)
-        acc
-        (sum-digits-tail (quotient n 10) (+ acc (remainder n 10)))))
+(define (sum-digits n) 
+    (define (sum-digits-tail n acc)
+        (if (zero? n)
+            acc
+            (sum-digits-tail (quotient n 10) (+ acc (remainder n 10)))))
+    (sum-digits-tail n 0))
 
 (define (get-sums max) (build-vector (+ (* 2 max) 1) sum-digits))