Пример #1
0
 public IEnumerable<Cell> GetValidMoves(IGame game)
 {
     return
         from col in Enumerable.Range(0, game.ColumnCount)
         let cell = game.Cells().Where(c => c.Col == col && game[c] == BlockState.Empty)
             .OrderByDescending(c => c.Row)
             .FirstOrNull()
         where cell.HasValue
         select cell.Value;
 }
Пример #2
0
 public IEnumerable<Cell> GetValidMoves(IGame game)
 {
     return game.Cells().Where(cell => game[cell] == BlockState.Empty);
 }