using System; using System.Collections.Generic; using System.Linq; static class Module1 { static Random r = new Random(); static List getThree(int n) { List g3 = new List(); for (int i = 0; i < 4; i++) g3.Add(r.Next(n) + 1); g3.Sort(); g3.RemoveAt(0); return g3; } static List getSix() { List g6 = new List(); for (int i = 0; i < 6; i++) g6.Add(getThree(6).Sum()); return g6; } static void Main(string[] args) { bool good = false; do { List gs = getSix(); int gss = gs.Sum(); int hvc = gs.FindAll(x => x > 14).Count; Console.Write("attribs: {0}, sum={1}, ({2} sum, high vals={3})", string.Join(", ", gs), gss, gss >= 75 ? "good" : "low", hvc); Console.WriteLine(" - {0}", (good = gs.Sum() >= 75 && hvc > 1) ? "success" : "failure"); } while (!good); } }