コード例 #1
0
            static void CreateDoge()
            {
                var rand = new Random();

                dogs = new Doge[100];
                for (int i = 0; i < 100; i++)
                {
                    int rndIndex  = rand.Next(dogeNames.Length);
                    int rndNumber = rand.Next(0, 100);
                    dogs[i] = new Doge(dogeNames[rndIndex], rndNumber, RandomDay(rand), NextBoolean(rand));
                    rand.Next(0, 100);
                }
            }
コード例 #2
0
        static void Generate()
        {
            var rand = new Random();

            dogs = new Doge[100];
            for (int i = 0; i < 100; i++)
            {
                int rndIndex  = rand.Next(dogeNames.Length);
                int rndWeight = rand.Next(1, 51);
                int day       = rand.Next(1, 29);
                int month     = rand.Next(1, 13);
                int year      = rand.Next(2015, 2021);
                dogs[i] = new Doge(dogeNames[rndIndex], rndWeight,
                                   new DateTime(year, month, day), NextBoolean(rand));
            }
        }