Commits

Anonymous committed 3897c09

Refactoring.

  • Participants
  • Parent commits 3c07272

Comments (0)

Files changed (1)

File solver/ruby/lib/kakuro_solver/board.rb

 
             total_masks = []
             @remaining_constraints = []
+            @possible_cell_values = @initial_cell_values
 
             DIRS.each do |dir|
                 other_dir = 1 - dir
 
-                t_mask = total_masks[other_dir] = 
-                    @constraints[other_dir].kakuro_combine_masks
+                t_mask = @constraints[other_dir].kakuro_combine_masks
+                @possible_cell_values &= t_mask
 
                 @remaining_constraints[dir] = \
                     @constraints[dir].select do |constraint| 
                     end
             end
 
-            @possible_cell_values = (
-                (@initial_cell_values & total_masks[VERT]) & 
-                    total_masks[HORIZ]
-            )
-
             return
         end