예제 #1
0
        //Generate the pills
        private static void GeneratePills()
        {
            Random rand = new Random();

            while (isRunning)
            {
                //Thread for the generation of the pills
                Thread.Sleep(1000);
                var row = (int)rand.Next(0, consoleWidth - 1);
                var col = (int)rand.Next(3, consoleHeight - 1);

                var row1 = (int)rand.Next(0, consoleWidth - 1);
                var col1 = (int)rand.Next(3, consoleHeight - 1);

                BadPill  badPill  = new BadPill(row, col);
                GoodPill goodPill = new GoodPill(row1, col1);

                pillsList.Add(badPill);

                pillsList.Add(goodPill);
            }
        }
예제 #2
0
        //Generate the pills
        private static void GeneratePills()
        {
            Random rand = new Random();
            while (isRunning)
            {
                //Thread for the generation of the pills
                Thread.Sleep(1000);
                var row = (int)rand.Next(0, consoleWidth - 1);
                var col = (int)rand.Next(3, consoleHeight - 1);

                var row1 = (int)rand.Next(0, consoleWidth - 1);
                var col1 = (int)rand.Next(3, consoleHeight - 1);

                BadPill badPill = new BadPill(row, col);
                GoodPill goodPill = new GoodPill(row1, col1);

                pillsList.Add(badPill);

                pillsList.Add(goodPill);
            }
        }