# HG changeset patch # User axmet # Date 1342190738 -14400 # Node ID f83e1e778061812121779ff1c02347658c68dae9 # Parent 80446fa5641a58265802b38dcf0a8b15792f0207 first changes diff -r 80446fa5641a -r f83e1e778061 bin/ru/bosony/icfpc/Mine.class Binary file bin/ru/bosony/icfpc/Mine.class has changed diff -r 80446fa5641a -r f83e1e778061 bin/ru/bosony/icfpc/cells/Cell.class Binary file bin/ru/bosony/icfpc/cells/Cell.class has changed diff -r 80446fa5641a -r f83e1e778061 src/ru/bosony/icfpc/Mine.java --- a/src/ru/bosony/icfpc/Mine.java Fri Jul 13 18:13:05 2012 +0400 +++ b/src/ru/bosony/icfpc/Mine.java Fri Jul 13 18:45:38 2012 +0400 @@ -1,10 +1,10 @@ package ru.bosony.icfpc; +import java.nio.file.FileVisitOption; import java.util.LinkedHashMap; import java.util.Map; import ru.bosony.icfpc.cells.Cell; -import ru.bosony.icfpc.cells.CellTypes; /** * Шахта @@ -16,44 +16,82 @@ { private Map cellPrototypes = new LinkedHashMap(); - private Cell cells[][]; + private Cell cells[][][]; + private int index = 0; public Mine(int n, int m, String content) { initCellPrototypes(); - cells = new Cell[n][m]; + cells = new Cell[2][n][m]; int index = 0; for(int i=0; i1; --j) + { + switch(firstBuffer()[i][j]) + { + case ROCK: + { + if(firstBuffer()[i][j-1] == Cell.EMPTY) + { + secondBuffer()[i][j] = Cell.EMPTY; + } + } + break; + } + } + } + } diff -r 80446fa5641a -r f83e1e778061 src/ru/bosony/icfpc/cells/Cell.java --- a/src/ru/bosony/icfpc/cells/Cell.java Fri Jul 13 18:13:05 2012 +0400 +++ b/src/ru/bosony/icfpc/cells/Cell.java Fri Jul 13 18:45:38 2012 +0400 @@ -1,32 +1,24 @@ package ru.bosony.icfpc.cells; -public class Cell +public enum Cell { + ROBOT('R'), + ROCK('*'), + EAGHT('.'), + WALL('#'), + LAMBDA('\\'), + CLOSED_LAMBDA_LIFT('L'), + OPEN_LAMBDA_LIFT('O'), + EMPTY(' '), + EARTH('.'); - private CellTypes type; private char ASCII; - public Cell(CellTypes type, char ASCII) + private Cell(char ASCII) { - this.type = type; this.ASCII = ASCII; } - public Cell(Cell cell) - { - this.type = cell.type; - this.ASCII = cell.ASCII; - } - - public CellTypes getType() - { - return type; - } - public void setType(CellTypes type) - { - this.type = type; - } - public char getASCII() { return ASCII;