| OLD | NEW |
| 1 part of ppw; | 1 part of ppw; |
| 2 | 2 |
| 3 class Field extends Array2d<bool> { | 3 class Field extends Array2d<bool> { |
| 4 final int bombCount; | 4 final int bombCount; |
| 5 final Array2d<int> _adjacents; | 5 final Array2d<int> _adjacents; |
| 6 | 6 |
| 7 factory Field([bombCount = 40, cols = 16, rows = 16, int seed = null]) { | 7 factory Field([bombCount = 40, cols = 16, rows = 16, int seed = null]) { |
| 8 final squares = new List<bool>.filled(rows * cols, false); | 8 final squares = new List<bool>.filled(rows * cols, false); |
| 9 assert(bombCount < squares.length); | 9 assert(bombCount < squares.length); |
| 10 assert(bombCount > 0); | 10 assert(bombCount > 0); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 val++; | 76 val++; |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 _adjacents.set(x, y, val); | 79 _adjacents.set(x, y, val); |
| 80 } | 80 } |
| 81 return val; | 81 return val; |
| 82 } | 82 } |
| 83 | 83 |
| 84 String toString() => 'w${width}h${height}m${bombCount}'; | 84 String toString() => 'w${width}h${height}m${bombCount}'; |
| 85 } | 85 } |
| OLD | NEW |