1 package ru.bosony.icfpc;
3 import java.util.LinkedHashMap;
6 import ru.bosony.icfpc.cells.Cell;
7 import ru.bosony.icfpc.cells.CellTypes;
17 private Map<Character, Cell> cellPrototypes = new LinkedHashMap<Character, Cell>();
19 private Cell cells[][];
21 public Mine(int n, int m, String content)
25 cells = new Cell[n][m];
29 for(int i=0; i<n; ++i)
30 for(int j=0; j<m; ++j)
32 cells[i][j] = new Cell( cellPrototypes.get(content.charAt(index++)) );
36 private void initCellPrototypes()
38 cellPrototypes.put('*', new Cell(CellTypes.ROCK, '*'));
39 cellPrototypes.put('\\', new Cell(CellTypes.LAMBDA, '\\'));
40 cellPrototypes.put('#', new Cell(CellTypes.WALL, '#'));
41 cellPrototypes.put('R', new Cell(CellTypes.ROBOT, 'R'));
42 cellPrototypes.put('L', new Cell(CellTypes.CLOSED_LAMBDA_LIFT, 'L'));
43 cellPrototypes.put('O', new Cell(CellTypes.OPEN_LAMBDA_LIFT, 'O'));
44 cellPrototypes.put(' ', new Cell(CellTypes.SPACE, ' '));
45 cellPrototypes.put('.', new Cell(CellTypes.EARTH, '.'));
50 for(int i=0; i<cells.length; ++i)
52 for(int j=0; j<cells[i].length; ++j)
54 System.out.print(cells[i][j].getASCII());