Skip to content

Instantly share code, notes, and snippets.

@thomasfedb
Created May 10, 2010 12:49
Show Gist options
  • Save thomasfedb/396007 to your computer and use it in GitHub Desktop.
Save thomasfedb/396007 to your computer and use it in GitHub Desktop.
class Cell
def initialize
@possible = (1..9).to_a
end
def cant_be(value)
@possible = @possible - [value]
end
def must_be(value)
@possible = [value]
end
def solved?
@possible.size == 1
end
def can_be
@possbile
end
def value
@possible.first if solved?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment