module ILoveSudoku::MatrixTools
Constants
- SUBGROUP_TOP_LEFT_COORDINATES
Private Instance Methods
deep_dup(any_matrix)
click to toggle source
# File lib/matrix_tools.rb, line 16 def deep_dup(any_matrix) any_matrix.each_with_object([]) do |row, dupe| dupe << row.dup end end
has_duplicates?(test_array)
click to toggle source
# File lib/matrix_tools.rb, line 22 def has_duplicates?(test_array) test_array = test_array.compact test_array.length != test_array.uniq.length end
subgroup_from(any_matrix, x, y)
click to toggle source
# File lib/matrix_tools.rb, line 10 def subgroup_from(any_matrix, x, y) any_matrix[x][y..y+2] + any_matrix[x+1][y..y+2] + any_matrix[x+2][y..y+2] end