197 return false; |
197 return false; |
198 } |
198 } |
199 } |
199 } |
200 } |
200 } |
201 |
201 |
202 return true; |
|
203 } |
|
204 |
|
205 private boolean complete(Field f) { |
|
206 for (int i = 0 ; i < 9 ; i++) { |
|
207 if (!complete(f.getRow(i))) { |
|
208 return false; |
|
209 } |
|
210 if (!complete(f.getColumn(i))) { |
|
211 return false; |
|
212 } |
|
213 } |
|
214 for (int x = 0 ; x < 3 ; x++) { |
|
215 for (int y = 0 ; y < 3 ; y++) { |
|
216 if (!complete(f.getSquare(x, y))) { |
|
217 return false; |
|
218 } |
|
219 } |
|
220 } |
|
221 return true; |
|
222 } |
|
223 |
|
224 private boolean complete(int[][] square) { |
|
225 for (int x = 0 ; x < 3 ; x++) { |
|
226 for (int y = 0 ; y < 3 ; y++) { |
|
227 if (square[x][y] == 0) { |
|
228 return false; |
|
229 } |
|
230 } |
|
231 } |
|
232 return true; |
|
233 } |
|
234 |
|
235 private boolean complete(int[] line) { |
|
236 for (int i = 0 ; i < 9 ; i++) { |
|
237 if (line[i] == 0) { |
|
238 return false; |
|
239 } |
|
240 } |
|
241 return true; |
202 return true; |
242 } |
203 } |
243 |
204 |
244 private boolean valid(int[] line) { |
205 private boolean valid(int[] line) { |
245 int numbers[]; |
206 int numbers[]; |