Round #580
09 May 2026, 23:18· csharp· Meta-Llama-3.3-70B-Instruct· r13-clean-hints
- Complexity
- band 0
- ZP / UO / OBS
- 3 / 0 / 2
- Journey weight
- 250
- Lightshift ΔL
- —
Prompt
Calculate a moving 7-day average of daily_sales using a window function.
Zero-point index (what the engine surfaced)
ZPI-ZPI-0014 | 2026-05-09T23:18:13Z
Calculate a moving 7-day average of daily_sales using a window function.
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 — 0 entries (implied truths)
OBSERVED — 2 entries (explicit in request)
◉ hsl(85.13, 100%, 50%) using [feature]
◉ hsl(234.87, 100%, 50%) using [feature]
COMPLEXITY │ 5 entries │ spread: 150° │ band: LOW
Baseline response (no ZPI)
```csharp
using System;
using System.Collections.Generic;
using System.Linq;
public class SalesData
{
public DateTime Date { get; set; }
public int DailySales { get; set; }
}
class Program
{
static void Main()
{
// Create a sample list of sales data
var salesData = new List<SalesData>
{
new SalesData { Date = DateTime.Parse("2022-01-01"), DailySales = 100 },
new SalesData { Date = DateTime.Parse("2022-01-02"), DailySales = 120 },
new SalesData { Date = DateTime.Parse("2022-01-03"), DailySales = 110 },
new SalesData { Date = DateTime.Parse("2022-01-04"), DailySales = 130 },
new SalesData { Date = DateTime.Parse("2022-01-05"), DailySales = 105 },
new SalesData { Date = DateTime.Parse("2022-01-06"), DailySales = 125 },
new SalesData { Date = DateTime.Parse("2022-01-07"), DailySales = 115 },
new SalesData { Date = DateTime.Parse("2022-01-08"), DailySales = 140 },
new SalesData { Date = DateTime.Parse("2022-01-09"), DailySales = 108 },
new SalesData { Date = DateTime.Parse("2022-01-10"), DailySales = 128 },
};
// Calculate the 7-day moving average
var movingAverage = salesData.Select((x, i) => new
{
Date = x.Date,
DailySales = x.DailySales,
MovingAverage = salesData.Skip(Math.Max(0, i - 6)).Take(7).Average(y => y.DailySales)
});
// Print the results
foreach (var item in movingAverage)
{
Console.WriteLine($"Date: {item.Date.ToString("yyyy-MM-dd")}, Daily Sales: {item.DailySales}, Moving Average: {item.MovingAverage}");
}
}
}
```
Enhanced response (with ZPI)
```csharp
using System;
using System.Data;
using System.Linq;
public class SalesData
{
public DateTime Date { get; set; }
public decimal DailySales { get; set; }
}
public class SalesCalculator
{
public static DataTable CalculateMovingAverage(DataTable salesData)
{
// Ensure the data is sorted by date
var sortedData = salesData.AsEnumerable().OrderBy(r => r.Field<DateTime>("Date"));
// Calculate the moving average
var movingAverages = sortedData.Select((row, index) =>
{
var startDate = row.Field<DateTime>("Date");
var endDate = startDate.AddDays(-6);
var windowData = sortedData.Where(r => r.Field<DateTime>("Date") >= endDate && r.Field<DateTime>("Date") <= startDate);
var average = windowData.Average(r => r.Field<decimal>("DailySales"));
return new { Date = startDate, MovingAverage = average };
});
// Create a new DataTable with the moving averages
var result = new DataTable();
result.Columns.Add("Date", typeof(DateTime));
result.Columns.Add("MovingAverage", typeof(decimal));
foreach (var average in movingAverages)
{
result.Rows.Add(average.Date, average.MovingAverage);
}
return result;
}
}
class Program
{
static void Main()
{
// Create a sample DataTable
var salesData = new DataTable();
salesData.Columns.Add("Date", typeof(DateTime));
salesData.Columns.Add("DailySales", typeof(decimal));
salesData.Rows.Add(new DateTime(2022, 1, 1), 100m);
salesData.Rows.Add(new DateTime(2022, 1, 2), 120m);
salesData.Rows.Add(new DateTime(2022, 1, 3), 110m);
salesData.Rows.Add(new DateTime(2022, 1, 4), 130m);
salesData.Rows.Add(new DateTime(2022, 1, 5), 140m);
salesData.Rows.Add(new DateTime(2022, 1, 6), 150m);
salesData.Rows.Add(new DateTime(2022, 1, 7), 160m);
salesData.Rows.Add(new DateTime(2022, 1, 8), 170m);
salesData.Rows.Add(new DateTime(2022, 1, 9), 180m);
salesData.Rows.Add(new DateTime(2022, 1, 10), 190m);
// Calculate the moving average
var movingAverages = SalesCalculator.CalculateMovingAverage(salesData);
// Print the results
foreach (DataRow row in movingAverages.Rows)
{
Console.WriteLine($"Date: {row["Date"]}, Moving Average: {row["MovingAverage"]}");
}
}
}
```
This C# code calculates a moving 7-day average of daily sales using a window function. It first sorts the sales data by date, then calculates the average sales for each 7-day window. The results are stored in a new DataTable, which is then printed to the console.
The `SalesCalculator` class contains a static method `CalculateMovingAverage` that takes a DataTable of sales data as input and returns a new DataTable with the moving averages. The `Main` method in the `Program` class demonstrates how to use this method with a sample DataTable.
Note that this implementation assumes that the input DataTable has columns named "Date" and "DailySales", and that the "Date" column contains DateTime values and the "DailySales" column contains decimal values. If your DataTable has different column names or data types, you may need to modify the code accordingly.
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
BetterV4qwen2.5-coder-3b-instruct
BetterV5openrouter/qwen/qwen3-235b-a22b-2507
BetterV7qwen2.5-coder-7b-instruct
BetterV8openai/gpt-4.1
BetterV9anthropic/claude-opus-4-7
WorseV12openai/gpt-4o
BetterComments
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.