| 259 | return puzzleX; |
| 260 | } |
| 261 | async report(n) { |
| 262 | console.time('PuzzleRecognizer'); |
| 263 | let count = 0; |
| 264 | for (let i = 0; i < n; i++) { |
| 265 | const x = await this.recognize(); |
| 266 | if (x > 0) count++; |
| 267 | if (i % 50 === 0) { |
| 268 | console.log('%f\%', (i / n) * 100); |
| 269 | } |
| 270 | } |
| 271 | console.log('successful: %f\%', (count / n) * 100); |
| 272 | console.timeEnd('PuzzleRecognizer'); |
| 273 | } |
| 274 | static jsonp(api, data = {}) { |
| 275 | return new Promise((resolve, reject) => { |
| 276 | const fnId = `jsonp_${String(Math.random()).replace('.', '')}`; |