Skip to content

Instantly share code, notes, and snippets.

@sanzencode
Created February 26, 2016 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sanzencode/027c1066049f5f78ba9c to your computer and use it in GitHub Desktop.
Save sanzencode/027c1066049f5f78ba9c to your computer and use it in GitHub Desktop.
obstructed logic - workinprogress
class Piece < ActiveRecord::Base
belongs_to :game
def obstructed_move?(x, y)
obstructed_space = a_piece_at_its_space(x, y)
return false if obstructed_space.empty?
return true if obstructed_space #is not empty
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment