示例#1
0
        private void Simulate()
        {
            if (Mode == 0) // The First Display Mode: Every grid will be drawn.
            {
                for (int i = 0; i < SimulationSpeed; i++)
                {
                    if (world.continu)
                    {
                        world.timeStep++;
                        world.Generate();
                        ConsoleDraw();
                    }
                    else
                    {
                        break;
                    }
                }
            }

            else if (Mode == 1) //The Second Display Mode: Only the last grid will be drawn.
            {
                for (int i = 0; i < SimulationSpeed; i++)
                {
                    if (world.continu)
                    {
                        world.timeStep++;
                        world.Generate();
                    }
                    else
                    {
                        break;
                    }
                }
                ConsoleDraw();
            }
        }