Как настроить консоль так, чтобы она выводила все символы сразу, вместо того чтобы выводить их поочередно? c#

using System;


class Program
{
    static void Main(string[] args)
    {
        int width = 120;
        int height = 30;
        float aspect = (float)width / height;
        float pixelAspect = 11f / 24f;
        char[] screen = new char[width * height + 1];
        screen[width * height] = '/';
        for(int t = 0; t < 10000; t++)
        {
            for (int w = 0; w < width; w++)
            {
                for (int h = 0; h < height; h++)
                {
                    float x = (float)w / width * 2 - 1;
                    float y = (float)h / height * 2 - 1;
                    char pixel = ' ';
                    x *= aspect * pixelAspect;
                    x += (float)Math.Sin(t * 
                                         0.0001);
                    if (x * x + y * y < 0.5)
                    {
                        pixel = '@';
                    }
                    screen[w + h * width] = pixel;
                }
            }
            Console.WriteLine(new string(screen));
        }
    }
}

Данный код должен выводит кадр из символов в консоль сразу, но вместо этого он выводит символы поочередно. Как мне это исправить?


Ответы (0 шт):