976d9874a0bb

Cleaner
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 01 Dec 2017 13:41:10 -0500
parents e07421f643fe
children e96ba6a7b654
branches/tags (none)
files src/main.lisp

Changes

--- a/src/main.lisp	Fri Dec 01 13:36:17 2017 -0500
+++ b/src/main.lisp	Fri Dec 01 13:41:10 2017 -0500
@@ -18,8 +18,8 @@
   (iterate
     (with data = (coerce (read-file-of-digits "data/2017/01-1") 'vector))
     (with length = (length data))
-    (with offset = (truncate length 2))
-    (for x :in-vector data :with-index i)
-    (for y = (aref data (mod (+ i offset) length)))
+    (for x :in-vector data)
+    (for iy :modulo length :from (truncate length 2))
+    (for y = (aref data iy))
     (when (= x y)
       (sum x))))