Beispiel #1
0
    public void Draw()
    {
        double r_in = this.Radius - 0.4;

        double r_out = this.Radius + 0.4;

        for (double y = this.Radius; y >= -this.Radius; --y)
        {
            for (double x = -this.Radius; x < r_out; x += 0.5)
            {
                double value = x * x + y * y;

                if (value >= r_in * r_in && value <= r_out * r_out)
                {
                    ModifiedOutputWriter.Write("*");
                }
                else
                {
                    ModifiedOutputWriter.Write(" ");
                }
            }

            ModifiedOutputWriter.WriteLine();
        }
    }
Beispiel #2
0
    private void DrawLine(double width, char end, char mid)
    {
        ModifiedOutputWriter.Write(end);

        for (int i = 1; i < width - 1; ++i)
        {
            ModifiedOutputWriter.Write(mid);
        }

        ModifiedOutputWriter.WriteLine(end);
    }