Minesweeper - built with liveview and other recent tools

Late to the party but for funsies :smile:

def neighbours2({x, y} = orig) do
  for x_mod <- [1, 0, -1],
    y_mod <- [-1, 0, 1],
    x_new = x + x_mod,
    y_new = y + y_mod,
    x_new in 0..8 and y_new in 0..8 and {x_new, y_new} != orig do
      {x_new, y_new}
  end
end
5 Likes