Sha256: b7ecc119ab20c2c4dc52a77a570a93195470779842bae39bec06a80b0af5e21f
Contents?: true
Size: 495 Bytes
Versions: 2
Compression:
Stored size: 495 Bytes
Contents
class Container attr_accessor :arr, :remaining_blocks def initialize(arr) @arr = arr end # Find the missing elements in the section def difference complete remaining end def remaining Array(1..9) - arr end def arr @arr.map!(&:to_i) end def contain?(num) complete arr.include? num end def pencil_in end def complete if remaining.count == 1 arr.map { |elem| elem == 0 ? remaining.first : elem } end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
sudoku-jedi-1.0.0 | lib/sudoku_solver/container.rb |
sudoku-jedi-0.0.4 | lib/sudoku_solver/container.rb |