Ver código fonte

added an extra row and column to guarantee surface coverage

Brandon Wong 7 anos atrás
pai
commit
be229931dc
1 arquivos alterados com 2 adições e 2 exclusões
  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) )
         _ ->