Skip to content

Commit 7fcef6f

Browse files
include spiral layout in geometry
1 parent e5b7b70 commit 7fcef6f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/civitas/explorer/geometry.clj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
(defn cube-spiral [radius]
5858
(mapcat cube-ring (range radius)))
5959

60+
(defn spiral [radius]
61+
(->> (cube-spiral radius)
62+
(map cube-to-cartesian-flat)))
63+
6064
(defn walk-radially [start-pos dir steps]
6165
(->> (iterate #(neighbor % dir) start-pos)
6266
(take (inc steps))))

0 commit comments

Comments
 (0)