Exemple #1
0
        static void Main(string[] args)
        {
            while (true)
            {
                var lottery = new Lottery();

                Console.WriteLine("Lottery started");

                lottery.Start();
                var winners = lottery.GetWinners();

                Console.WriteLine("Winning Numbers :");

                Console.WriteLine(lottery.GetWinningNumbers());

                Console.WriteLine("Winners :");

                winners.ForEach(w => Console.WriteLine(w.ToString()));

                Console.WriteLine(string.Empty);

                Console.ReadKey();
            }
        }
Exemple #2
0
 public Contestant(Lottery lottery, int no)
 {
     _lottery = lottery;
     No       = no;
     Numbers  = new NumberGenerator().Generate();
 }