8 lines
242 B
Text
8 lines
242 B
Text
spiralMatrix.spiralMatrix : Nat -> [[Nat]]
|
|
spiralMatrix.spiralMatrix = cases
|
|
0 -> []
|
|
n ->
|
|
go h w s = match h with
|
|
0 -> []
|
|
h' -> Nat.range s (s + w) +: (List.reverse >> List.transpose) (go w (h' - 1) (w + s))
|
|
go n n 1
|