diff --git a/src/Grid.elm b/src/Grid.elm index 7b7c3ba..c4946fa 100644 --- a/src/Grid.elm +++ b/src/Grid.elm @@ -1,4 +1,4 @@ -module Grid exposing (FromRowsAndColumnsProblem, Grid, fromDimensions, fromRowsAndColumns, fromRowsAndColumnsArray, get, getWrapping, indexedMap, initialize, map, rotate, set, toArrays, topLeft, update, view, windows) +module Grid exposing (FromRowsAndColumnsProblem, Grid, fromRowsAndColumns, fromRowsAndColumnsArray, get, getWrapping, indexedMap, initialize, map, rotate, set, toArrays, topLeft, update, view, windows) import Array exposing (Array) import Color.Transparent as Color exposing (Color) @@ -30,27 +30,6 @@ initialize { rows, columns } init = } -{-| TODO remove this or initialize --} -fromDimensions : ({ row : Int, column : Int } -> a) -> { rows : Int, columns : Int } -> Grid a -fromDimensions initter { rows, columns } = - Grid - { width = columns - , height = rows - , items = - Array.initialize rows - (\rowNum -> - Array.initialize columns - (\colNum -> - initter - { row = rowNum - , column = colNum - } - ) - ) - } - - {-| Construct a grid from a list of lists. The outer list is a list of rows, and the inner lists are values in columns. diff --git a/src/Wave.elm b/src/Wave.elm index f8a5c70..6db6396 100644 --- a/src/Wave.elm +++ b/src/Wave.elm @@ -74,10 +74,11 @@ init rules weights dimensions = |> Heap.thenBy (.coords >> .column) ) , items = - Grid.fromDimensions (always initialCell) + Grid.initialize { rows = dimensions.height , columns = dimensions.width } + (always initialCell) }