lib/combinatorial_puzzle_solver/solution_space.rb
# Creates a clone of the solution space and tries to solve it with the assumption
# that the given identifier has the given value.
# @return [SolutionSpace, nil] a solution space that is completely resolved, or
#                              nil if no complete solution was found.
Creates a clone of the solution space and tries to solve it with the assumption
that the given identifier has the given value.
Creates a clone of the solution space and tries to solve it with the assumption that the given identifier has the given value .
def try_resolve_with(identifier, value)
      possible_solution_space = SolutionSpace.new(self)
      assumption = {identifier => value}
      begin
        if possible_solution_space.resolve!(assumption) then
          return possible_solution_space
        else
          return possible_solution_space.resolve_by_trial_and_error!
        end
      rescue Inconsistency
        return nil
      end
    end
def try_resolve_with ( identifier , value ) possible_solution_space = SolutionSpace . new ( self ) assumption = { identifier => value } begin if possible_solution_space . resolve! ( assumption ) then return possible_solution_space else return possible_solution_space . resolve_by_trial_and_error! end rescue Inconsistency return nil end end
Creates a clone of the solution space and tries to solve it with the assumption
that the given identifier has the given value.
Creates a clone of the solution space and tries to solve it with the assumption that the given identifier has the given value .
a solution space that is completely resolved, or nil if no complete solution was found.
a solution space that is completely resolved or nil if no complete solution was found .
SolutionSpace, nil
identifier
<not_specific>
value
<not_specific>