Serializes the current solution to a string.
(Entry[] solution)
| 230 | */ |
| 231 | |
| 232 | private String serialize (Entry[] solution) |
| 233 | { char[] puzzle = new char[50]; |
| 234 | Shape shape; |
| 235 | int row; |
| 236 | int col; |
| 237 | |
| 238 | for (Entry entry: solution) |
| 239 | { shape = entry.shape; |
| 240 | row = entry.row; |
| 241 | col = entry.col; |
| 242 | |
| 243 | for (int[] xy: shape.vector) |
| 244 | puzzle[5 * (row + xy[0]) + (col + xy[1])/2] = shape.symbol; |
| 245 | } |
| 246 | |
| 247 | return new String(puzzle); |
| 248 | } |
| 249 | |
| 250 | // INNER CLASSES |
| 251 |