using System; using System.Collections.Generic; namespace PopTheLockClone; public static class ExtensionMethods { private static Random _random = new Random(); public static T ShitOutRandomChoice(this IList list) { if (list == null || list.Count == 0) throw new InvalidOperationException("Cannot select a random element from an empty or null list."); int index = _random.Next(list.Count); return list[index]; } }