diff --git a/_posts/2024-07-16-minesweeper-100-lines-of-clean-ruby.markdown b/_posts/2024-07-16-minesweeper-100-lines-of-clean-ruby.markdown index 53d5aa2..81244d3 100644 --- a/_posts/2024-07-16-minesweeper-100-lines-of-clean-ruby.markdown +++ b/_posts/2024-07-16-minesweeper-100-lines-of-clean-ruby.markdown @@ -138,7 +138,7 @@ Finally, if we hit a mine we exit early with `:lose`. Otherwise we check if all The only thing missing here is the neighbours method on the coordinate. We implement it by first creating a list of offsets to all 8 neighbours: ```ruby Coordinate = Data.define(:x, :y) do - NEIGHBOURS = (Enumerator.product([-1, 0, 1], [-1, 0, 1]).to_a - [0, 0]).map { |x, y| self.new(x, y) } + NEIGHBOURS = (Enumerator.product([-1, 0, 1], [-1, 0, 1]).to_a - [[0, 0]]).map { |x, y| self.new(x, y) } # ... end ```