sudoku_gem 1.0.0 → 1.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc3301c8876d099d322ce989574598232841a388
4
- data.tar.gz: 333dc8fa1b65c8296e571c7316279e660405556d
3
+ metadata.gz: 6cccc05929af1842c549d0f9300115665ecafffe
4
+ data.tar.gz: 522fa69b45d326630ebfeb2d6dbeb239862aab01
5
5
  SHA512:
6
- metadata.gz: 6aec0f8e6e95b1b38b0a8212b425f108f429f13018a702d7e7f57d80235457ace45627fbc3e5405104a1cf5917bb0098a4e3a1ff1f449372625a621dad072435
7
- data.tar.gz: 9f28eae02891e28f1388b0fab319bc6b93b99b271c58148a592e341618f4cf19d011ce6887ca1058695a43df9877d4425029fd8788a3c9aa5fab6cf18c5d18af
6
+ metadata.gz: aa0336157ca9508b97b41d32bdf139f07632f6fe86e727367a62e67fb30448a771a6df2336ef8ded1e8e111bcf6f6d2b895d6c4515fa016f27c160954413c7e5
7
+ data.tar.gz: 877a8aa68189d466919de02f292c1779366d244b1dac7612d8258348f99c8a2bdfe33d4c476f899233b8bebd44d30f8f0d7ecce5aaa0fb46a4a1cfd7fc6ad0d7
@@ -103,7 +103,10 @@ bool Sudoku::parse_puzzle(std::istream& f)
103
103
  this->grid.reset(n);
104
104
 
105
105
  //put in the first row
106
- this->insert_row(tokens, 0);
106
+ if (!this->insert_row(tokens, 0))
107
+ {
108
+ return false;
109
+ }
107
110
 
108
111
  //read n-1 lines
109
112
  for (std::size_t y = 1; y < n; y++)
@@ -119,7 +122,10 @@ bool Sudoku::parse_puzzle(std::istream& f)
119
122
  }
120
123
 
121
124
  //insert that row
122
- this->insert_row(tokens, y);
125
+ if (!this->insert_row(tokens, y))
126
+ {
127
+ return false;
128
+ }
123
129
  }
124
130
 
125
131
  return true;
@@ -1,7 +1,6 @@
1
1
  #include <ruby.h>
2
2
  #include <string>
3
3
  #include "sudoku.h"
4
- #include <iostream>
5
4
 
6
5
  typedef VALUE (* ruby_method)(...);
7
6
 
@@ -18,9 +17,9 @@ VALUE sudoku_gem_solve(VALUE self, VALUE rb_puzzle)
18
17
 
19
18
  sudoku.solve_colorability_style();
20
19
 
21
- std::string solution = sudoku.to_s();
20
+ std::string cpp_solution = sudoku.to_s();
22
21
 
23
- return rb_str_new(solution.c_str(), solution.length());
22
+ return rb_str_new(cpp_solution.c_str(), cpp_solution.length());
24
23
  }
25
24
 
26
25
  extern "C"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sudoku_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neal Patel