public ConnectedSameCellsTest() { _connectedSameCellsFinder = new ConnectedSameCellsFinder(); _cellsBuilder = new CellsBuilder(); int[,] array = new[, ] { { 0, 1, 2, 2, 3 }, { 3, 3, 4, 4, 4 }, { 3, 2, 1, 2, 6 }, { 3, 1, 2, 1, 4 }, { 3, 1, 2, 1, 4 }, }; _cells = _cellsBuilder.Build(array); }
public int Execute(int[,] array) { var result = 0; var cells = _cellsBuilder.Build(array); while (!AllCellsHaveSameColor(cells)) { result = result + 1; _moveToNextColor.Move(cells); _progress.ProcessProgress(cells); } return(result); }
public ChangedCellNeighboursFinderTest() { _connectedSameCellsFinder = new ConnectedSameCellsFinder(); _changedCellNeighboursFinder = new ChangedCellNeighboursFinder(_connectedSameCellsFinder); _cellsBuilder = new CellsBuilder(); int[,] array = new[, ] { { 0, 1, 2, 2, 3 }, { 3, 3, 4, 4, 4 }, { 3, 2, 1, 2, 6 }, { 3, 1, 2, 1, 4 }, { 3, 1, 2, 1, 4 }, }; _cells = _cellsBuilder.Build(array); _cells.GetCell(0, 0).Changed = true; }