OLD | NEW |
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
4 * | 4 * |
5 * The contents of this file are subject to the Mozilla Public License Version | 5 * The contents of this file are subject to the Mozilla Public License Version |
6 * 1.1 (the "License"); you may not use this file except in compliance with | 6 * 1.1 (the "License"); you may not use this file except in compliance with |
7 * the License. You may obtain a copy of the License at | 7 * the License. You may obtain a copy of the License at |
8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
9 * | 9 * |
10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 // XXX Math.min etc. should work on arrays (lists or tuples in Python) as we
ll as numbers | 218 // XXX Math.min etc. should work on arrays (lists or tuples in Python) as we
ll as numbers |
219 let a = [values[s].length + s for (s in squares) if (values[s].length > 1)].
sort() | 219 let a = [values[s].length + s for (s in squares) if (values[s].length > 1)].
sort() |
220 let s = a[0].slice(-2) | 220 let s = a[0].slice(-2) |
221 | 221 |
222 return some(search(assign(values.copy(), s, d)) for (d in values[s])) | 222 return some(search(assign(values.copy(), s, d)) for (d in values[s])) |
223 } | 223 } |
224 | 224 |
225 hard = '4.....8.5.3..........7......2.....6.....8.4......1.......6.3.7.5..2.....
1.4......' | 225 hard = '4.....8.5.3..........7......2.....6.....8.4......1.......6.3.7.5..2.....
1.4......' |
226 | 226 |
227 print_board(search(parse_grid(hard))) | 227 print_board(search(parse_grid(hard))) |
| 228 |
| 229 delete Object.prototype.copy; |
228 | 230 |
229 reportCompare(expect, actual, summary); | 231 reportCompare(expect, actual, summary); |
230 | 232 |
231 exitFunc ('test'); | 233 exitFunc ('test'); |
232 } | 234 } |
OLD | NEW |