Skip to content

Instantly share code, notes, and snippets.

@kenmazaika
Created July 3, 2015 14:14
Show Gist options
  • Save kenmazaika/418371112fffe7eadae9 to your computer and use it in GitHub Desktop.
Save kenmazaika/418371112fffe7eadae9 to your computer and use it in GitHub Desktop.
def is_obstructed?(x, y)
return false if self.x_coord != x
# this could be a horizontal obstruction - let's check
(x..self.x_coord).each do |x_pos|
# is there a piece in position `x_pos`, y
# if there is there's an obstruction
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment