Round #729

10 May 2026, 15:16· csharp· Meta-Llama-3.3-70B-Instruct· r13-clean-hints
Complexity
band 0
ZP / UO / OBS
3 / 2 / 1
Journey weight
390
Lightshift ΔL

Prompt

Write a LINQ query to filter a list of objects by a property.

Zero-point index (what the engine surfaced)

ZPI-ZPI-0003 | 2026-05-10T15:16:26Z Write a LINQ query to filter a list of objects by a property. ZERO POINT — 3 entries (structural invariants) ● hsl(7.18, 100%, 50%) class [feature] ● hsl(0.00, 100%, 50%) public [feature] ● hsl(84.10, 100%, 50%) namespace [feature] UNOBSERVED — 2 entries (implied truths) ○ hsl(340.51, 100%, 22%) IEnumerable of T [feature] ○ hsl(15.38, 100%, 22%) var [feature] OBSERVED — 1 entries (explicit in request) ◉ hsl(324.10, 100%, 15%) List of T [feature] COMPLEXITY │ 6 entries │ spread: 325° │ band: LOW

Baseline response (no ZPI)

**Filtering a List of Objects by a Property using LINQ** =========================================================== Here's an example of how you can use LINQ to filter a list of objects by a property in C#: ```csharp using System; using System.Collections.Generic; using System.Linq; public class Person { public string Name { get; set; } public int Age { get; set; } } class Program { static void Main() { // Create a list of Person objects List<Person> people = new List<Person> { new Person { Name = "John", Age = 25 }, new Person { Name = "Alice", Age = 30 }, new Person { Name = "Bob", Age = 25 }, new Person { Name = "Charlie", Age = 35 } }; // Use LINQ to filter the list by Age var filteredPeople = people.Where(p => p.Age == 25); // Print the filtered results foreach (var person in filteredPeople) { Console.WriteLine($"Name: {person.Name}, Age: {person.Age}"); } } } ``` **How it Works** --------------- 1. We define a `Person` class with `Name` and `Age` properties. 2. We create a list of `Person` objects. 3. We use the `Where` method from LINQ to filter the list. The lambda expression `p => p.Age == 25` specifies the condition for filtering. 4. The `Where` method returns an `IEnumerable<Person>` that contains only the objects that match the condition. 5. We iterate over the filtered results and print the `Name` and `Age` of each person. **Tips and Variations** ---------------------- * You can use other LINQ methods like `FirstOrDefault`, `Single`, or `Any` to filter the list. * You can use multiple conditions in the lambda expression by using logical operators like `&&` or `||`. * You can use LINQ's `OrderBy` or `OrderByDescending` methods to sort the filtered results. * You can use LINQ's `Select` method to project the filtered results into a new form.

Enhanced response (with ZPI)

```csharp using System; using System.Collections.Generic; using System.Linq; public class Person { public string Name { get; set; } public int Age { get; set; } } class Program { static void Main() { // Create a list of Person objects List<Person> people = new List<Person> { new Person { Name = "John", Age = 25 }, new Person { Name = "Alice", Age = 30 }, new Person { Name = "Bob", Age = 25 }, new Person { Name = "Charlie", Age = 35 }, }; // LINQ query to filter people by Age var filteredPeople = people.Where(p => p.Age == 25); // Print the filtered results foreach (var person in filteredPeople) { Console.WriteLine($"Name: {person.Name}, Age: {person.Age}"); } } } ``` This code defines a `Person` class with `Name` and `Age` properties. It then creates a list of `Person` objects and uses a LINQ query to filter the list for people with an `Age` of 25. The filtered results are printed to the console. **Explanation:** * The `Where` method is used to filter the list of `Person` objects based on a condition. * The condition `p => p.Age == 25` is a lambda expression that specifies the filter criteria. It takes a `Person` object `p` as input and returns `true` if the `Age` property is equal to 25, and `false` otherwise. * The `Where` method returns an `IEnumerable<Person>` that contains only the `Person` objects that satisfy the filter condition. * The `foreach` loop is used to iterate over the filtered results and print the `Name` and `Age` properties of each `Person` object.

Grader chain

Each grader reads the same baseline + enhanced pair and casts an independent verdict. Disagreement is the framework's own signal — not noise to be averaged away.

V1samba/Meta-Llama-3.3-70B-Instruct
Worse
V4qwen2.5-coder-3b-instruct
Better
V5openrouter/qwen/qwen3-235b-a22b-2507
Same
V7qwen2.5-coder-7b-instruct
Same
V8openai/gpt-4.1
Same
V9anthropic/claude-opus-4-7
Worse
V12openai/gpt-4o
Same

Comments

Our grader said what it said. What do you say? Comment as a guest below.

No comments yet. Be the first to say what you make of this round.

← back to all rounds