var result = numbers.Where(num => num > 100).Reverse().Take(3)
Reverse().ToArray()
ForEach
public List<Slot> FuelSlots = new List<Slot>(); public List<Slot> InputSlots = new List<Slot>(); public List<Slot> OutputSlots = new List<Slot>();
Location location = GetNextLocationFromInput();location.ResolveEvents()
static class Input { public static string? GetInput(string prompt) { Console.Write($"{prompt}: "); return Console.ReadLine()? .Trim()? .ToLower(); }}static class TestWorld { public static void Shop() { Console.WriteLine("Welcome to the shop"); } public static void Arena() { Console.WriteLine("Welcome to the arena"); }}class Program { static void Main() { var userInput = Input.GetInput("shop or arena?")!; var place = userInput switch { "shop" => TestWorld.Shop, "arena" => TestWorld.Arena, _ => throw new Exception(), }; place(); }}
No best type was found for the switch expression.