예제 #1
0
 // define a DELEGAT so it can sende Lotto numbers to subscribes
 // Create an EVENT or a delegate instance
 static void Main(string[] args)
 {
     DanskeSpil ds = new DanskeSpil();
     LottoPlayer pl = new LottoPlayer(ds);
     // Try to create more player with different numbers
     // When number is set remember to catch exception
     ds.Draw();
 }
예제 #2
0
        static void Main(string[] args)
        {
            DanskeSpil ds = new DanskeSpil();
            LottoPlayer pl = new LottoPlayer(ds);
            pl = new LottoPlayer(ds, new[] { 5, 9, 15, 22, 24, 29, 32 });
            pl = new LottoPlayer(ds, new[] { 15, 19, 20, 25, 26, 29, 30 });

            // Try to create more player with different numbers
            // When number is set remember to catch exception
            ds.Draw();
        }
예제 #3
0
        static void Main(string[] args)
        {
            Random n = new Random(DateTime.Now.Millisecond);
            DanskeSpil ds = new DanskeSpil();
            LottoPlayer pl = new LottoPlayer(ds);
            LottoPlayer p2 = new LottoPlayer(ds);
            for (int i = 0; i <= 6; i++) p2.MyNum[i] = n.Next(1, 36);
            LottoPlayer p3 = new LottoPlayer(ds);
            for (int i = 0; i <= 6; i++) p3.MyNum[i] = n.Next(1, 36);
            LottoPlayer p4 = new LottoPlayer(ds);
            for (int i = 0; i <= 6; i++) p4.MyNum[i] = n.Next(1, 36);
            List<LottoPlayer> PlayerList = new List<LottoPlayer>();
            for (int x = 5; x<1000000; x++)
            {
                LottoPlayer player = new LottoPlayer(ds);
                for (int i = 0; i <= 6; i++) player.MyNum[i] = n.Next(1, 36);
                PlayerList.Add(player);
            }

            // Try to create more player with different numbers
            // When number is set remember to catch exception
            ds.Draw();
        }
예제 #4
0
 public LottoPlayer(DanskeSpil ds)
 {
     this.ds = ds;
     ds.XxEventx += Ds_XxEventx;
 }
예제 #5
0
 public LottoPlayer(DanskeSpil ds)
 {
     this.ds = ds;
     // Subscribe the Lotto drawing by DanskeSpil
 }