sudokude 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/sudokude.rb +13 -13
  2. metadata +2 -2
data/lib/sudokude.rb CHANGED
@@ -36,7 +36,7 @@ module Sudokude
36
36
  end
37
37
 
38
38
  def print
39
- @sudoku.values.each_slice(9).to_a.each do |row|
39
+ self.each do |row|
40
40
  row.map! do |e|
41
41
  if e.nil?
42
42
  "n"
@@ -97,25 +97,25 @@ module Sudokude
97
97
  end
98
98
  end
99
99
 
100
- print
100
+ return @sudoku.values.each_slice(9).to_a
101
101
 
102
102
  end
103
103
 
104
104
  private
105
105
 
106
- # Array#compact removes all nils. A solved puzzle has no nils to remove.
107
- def solved
108
- @sudoku.values.compact.size == 81
109
- end
106
+ # Array#compact removes all nils. A solved puzzle has no nils to remove.
107
+ def solved
108
+ @sudoku.values.compact.size == 81
109
+ end
110
110
 
111
111
 
112
- # This evaluates the number of solved keys in the puzzle. If no new blanks have been
113
- # filled in over multiple passes through the solving methods, then the puzzle cannot
114
- # be solved.
115
- def unsolvable
116
- @keysizes << @sudoku.values.compact.size
117
- @keysizes[-1] == @keysizes[-3]
118
- end
112
+ # This evaluates the number of solved keys in the puzzle. If no new blanks have been
113
+ # filled in over multiple passes through the solving methods, then the puzzle cannot
114
+ # be solved.
115
+ def unsolvable
116
+ @keysizes << @sudoku.values.compact.size
117
+ @keysizes[-1] == @keysizes[-3]
118
+ end
119
119
 
120
120
  end
121
121
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 0
9
- version: 1.0.0
8
+ - 2
9
+ version: 1.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Dan Chao