예제 #1
0
 private IList<bool> ExploreRow(IList<bool> row, int rowIndex, Coordinates coordinates)
 {
     return row
         .Select((explored, columnIndex) => (coordinates.ColumnIndex == columnIndex && coordinates.RowIndex == rowIndex) || explored)
         .ToList();
 }
예제 #2
0
 private IList<IList<bool>> ExploreSquares(IList<IList<bool>> squares, Coordinates coordinates)
 {
     return squares
         .Select((row, rowIndex) => ExploreRow(row, rowIndex, coordinates))
         .ToList();
 }
예제 #3
0
 public Minefield Explore(Coordinates coordinates)
 {
     return new Minefield(_width, _height, ExploreSquares(_squares, coordinates));
 }