Slice with lambda: add C# exercise projects and export
- Add SliceWithLambda.slnx + csproj scaffolding for ideas/slice-with-lambda/ exercise/csharp (examples project + xUnit solution/test project) - Add exercises/slice-with-lambda (C# version of the prefactored-longrange exercise with Buyers and SliceWithLambda projects) - Add export/slice-with-lambda (nested git repo with exercise export) - Ignore bin/ and obj/ build output at repo root
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace IceCreamBuyers
|
||||
{
|
||||
public class PriceList
|
||||
{
|
||||
// placeholder implementation - real version would call the pricing service
|
||||
private static readonly Dictionary<IceCream, int> BasePrices =
|
||||
new()
|
||||
{
|
||||
{ IceCream.Strawberry, 3 },
|
||||
{ IceCream.Vanilla, 2 },
|
||||
{ IceCream.Chocolate, 4 },
|
||||
};
|
||||
|
||||
public int PriceFor(IceCream flavour)
|
||||
{
|
||||
return BasePrices[flavour] + SurgePricing();
|
||||
}
|
||||
|
||||
private int SurgePricing()
|
||||
{
|
||||
return new Random().Next(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user