Explorar o código

added an extra row and column to guarantee surface coverage

Brandon Wong %!s(int64=7) %!d(string=hai) anos
pai
achega
be229931dc
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      Main.elm

+ 2 - 2
Main.elm

@@ -163,8 +163,8 @@ update msg model =
             ( { model | board = board }, Cmd.none )
         InitializeBoard size ->
             let
-                numRows = size.height // cellSize
-                numCols = size.width // cellSize
+                numRows = size.height // cellSize + 1
+                numCols = size.width // cellSize + 1
             in
                 ( model, Random.generate SetBoard (generateRandom numRows numCols) )
         _ ->