Skip to content

Instantly share code, notes, and snippets.

@joshwalsh
Created January 26, 2010 03:26
Show Gist options
  • Save joshwalsh/286516 to your computer and use it in GitHub Desktop.
Save joshwalsh/286516 to your computer and use it in GitHub Desktop.
def empty_neighbor_cells(x,y)
return_value = []
neighbors(x, y).each do |neighbor|
return_value << neighbor if !occupied? neighbor
end
return_value
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment