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; }
public IEnumerable<Cell> GetValidMoves(IGame game) { return game.Cells().Where(cell => game[cell] == BlockState.Empty); }