Created
May 10, 2010 12:49
-
-
Save thomasfedb/396007 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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