2017
Matthew Butterick 7 years ago
parent 040ffb8a80
commit 196f710363

@ -17,7 +17,7 @@
(define digits (for/list ([c (in-string (number->string num))]) (define digits (for/list ([c (in-string (number->string num))])
(string->number (string c)))) (string->number (string c))))
(define offset (if (eq? offset-sig ') -1 (/ (length digits) 2))) (define offset (if (eq? offset-sig ') -1 (/ (length digits) 2)))
(for/sum ([first (in-list digits)] (for/sum ([digit (in-list digits)]
[second (in-list (shift-cycle digits offset))] [other-digit (in-list (shift-cycle digits offset))]
#:when (= first second)) #:when (= digit other-digit))
first)) digit))