Beispiel #1
0
        public static void Start()
        {
            Tortoise.Show();
            Tortoise.SetSpeed(10);
            ColorWheel.AddColor(Colors.BlueViolet);
            ColorWheel.AddColor(Colors.Violet);
            ColorWheel.AddColor(Colors.Purple);

            for (int i = 0; i < 75; i++)
            {
                try
                {
                    //var aaa = 100 / i;

                    var nextColor = ColorWheel.GetNextColor();
                    Tortoise.SetPenColor(nextColor);

                    Tortoise.Move((i + 1) * 5);
                    Tortoise.Turn(360.0 / 3);
                }
                catch (Exception re)
                {
                    MessageBox.ShowMessage("Hold up: " + re);
                }
            }
        }
Beispiel #2
0
        public static void Main2()
        {
            Tortoise.Show();
            Tortoise.SetSpeed(10);
            Tortoise.InstantSpeed(false);
            //var sides = MessageBox.AskForInput("Hány oldal legyen?"); // int - integer - egész szám
            var sides = 25;

            //Tortoise.SetPenColor(Colors.GetRandomColor());
            for (int i = 0; i < sides; i = i + 1)
            {
                var color = Colors.GetRandomColor();
                Tortoise.SetPenColor(color); // string - szöveg
                Tortoise.SetPenWidth(i * 2);
                Tortoise.Move(i * 1.5);
                Tortoise.Turn(-3 * 360.0 / sides);

                //string s1 = 'a'.ToString();
                //char c1 = 'a';

                //string sdf = "" + 3;
                // 360.0 / 13;
                // 360.0 / 13.0;


                //new Random().Next();

                // 360  /13 => int    / int => 27
                // 360.0/13 => double / int => 27.69...

                // 360   - int
                // 360.0 - double
            }
        }
Beispiel #3
0
        public static void Start()
        {
            Tortoise.Show();
            Tortoise.Hide();
            Tortoise.SetX(225);
            Tortoise.SetY(150);

            Tortoise.SetSpeed(10);
            ColorWheel.AddColor(Colors.Crimson);
            ColorWheel.AddColor(Colors.DarkRed);
            ColorWheel.AddColor(Colors.FireBrick);
            for (int i = 0; i < 6; i++)
            {
                Tortoise.SetPenColor(ColorWheel.GetNextColor());
                Tortoise.Move((i + 1) * 4);
                Tortoise.Turn(-360.0 / 6);
                for (int j = 0; j < 15; j++)
                {
                    Tortoise.SetPenWidth(17);
                    Tortoise.Move((j + 1) * 8);
                    Tortoise.Turn(360.0 / 5);
                }

                //--Tortoise.getBackgroundWindow().setBackground(PenColors.Yellows.PeachPuff);
            }

            Tortoise.SetX(300);
            Tortoise.SetY(200);
            for (int i = 0; i < 5; i++)
            {
                Tortoise.SetPenColor("Black");
                Tortoise.Move(25);
                Tortoise.Turn(360.0 / 5);
            }
        }
Beispiel #4
0
 private static void AdjustColor_WithIfs(int currentBranchLength)
 {
     if (currentBranchLength == 60)
     {
         Tortoise.SetPenColor(Colors.SaddleBrown);
     }
     //...
 }
Beispiel #5
0
 private static void setUpPyramidLand()
 {
     Tortoise.Show();
     Tortoise.SetSpeed(10);
     //Tortoise.GetBackgroundWindow().setBackground(Colors.AliceBlue);
     Tortoise.SetPenColor(Colors.DarkGoldenrod);
     Tortoise.SetPenWidth(2);
     Tortoise.Hide();
 }
Beispiel #6
0
        public static void Start()
        {
            Tortoise.Show();
            Tortoise.SetPenColor(Colors.Gold);
            Tortoise.SetSpeed(10);
            double length = 100.0;

            MakeASquare(length);
        }
Beispiel #7
0
 private static void DrawOctogon()
 {
     for (int i = 0; i < 8; i++)
     {
         var nextColor = ColorWheel.GetNextColor();
         Tortoise.SetPenColor(nextColor);
         Tortoise.Move(50);
         Tortoise.Turn(360.0 / 8);
     }
 }
Beispiel #8
0
        private static void AdjustPen()
        {
            Tortoise.SetPenColor(ColorWheel.GetNextColor());
            var width = Tortoise.GetPenWidth();

            Tortoise.SetPenWidth(width + 1);
            if (Tortoise.GetPenWidth() > 4)
            {
                Tortoise.SetPenWidth(1);
            }
        }
Beispiel #9
0
 private static void drawHouse(int height)
 {
     Tortoise.SetPenColor(Colors.GetRandomColor());
     Tortoise.Move(height);
     Tortoise.Turn(90);
     Tortoise.Move(30);
     Tortoise.Turn(90);
     Tortoise.Move(height);
     Tortoise.Turn(-90);
     Tortoise.Move(20);
     Tortoise.Turn(-90);
 }
Beispiel #10
0
        private static void AdjustColor(int currentBranchLength)
        {
            var colors = new Dictionary <int, string>();

            colors.Add(10, Colors.Lime);
            colors.Add(20, Colors.ForestGreen);
            colors.Add(30, Colors.DarkGreen);
            colors.Add(40, Colors.Olive);
            colors.Add(50, Colors.Sienna);
            colors.Add(60, Colors.SaddleBrown);

            Tortoise.SetPenColor(colors[currentBranchLength]);
        }
Beispiel #11
0
        public static void Main2()
        {
            int length = 1;

            Tortoise.Show();
            Tortoise.SetSpeed(10);
            for (int i = 0; i < 60; i++)
            {
                DrawTriangle(length);
                Tortoise.SetPenColor(Colors.GetRandomColor());
                length = length + 4;
                Tortoise.Turn(360.0 / 60);
            }
        }
Beispiel #12
0
 public static void Start()
 {
     Tortoise.Show();
     Tortoise.SetSpeed(10);
     CreateColorPalette();
     for (int i = 0; i < 30; i++)
     {
         var nextColor = ColorWheel.GetNextColor();
         Tortoise.SetPenColor(nextColor);
         DrawOctagonWithOverlap();
         Tortoise.Turn(360.0 / 30);
         Tortoise.Turn(5);
     }
 }
Beispiel #13
0
        public static void Main()
        {
            Tortoise.Show();
            Tortoise.SetSpeed(10);
            var sides = 100;

            for (int i = 0; i < sides; i++)
            {
                Tortoise.SetPenColor("interblue");
                Tortoise.SetPenWidth(new Random().Next(1, 10));
                Tortoise.Move(100);
                Tortoise.Turn(100);
            }
        }
Beispiel #14
0
        public static void Start()
        {
            Tortoise.Show();
            Tortoise.SetSpeed(10);
            Tortoise.SetPenWidth(1);
            Tortoise.SetPenColor("black");
            var lineLength = 10.5;
            var zoom       = 1.1;

            for (int i = 0; i < 10; i++)
            {
                WeaveOneLayer(lineLength, zoom);
                zoom = zoom * 1.3;
            }
        }
Beispiel #15
0
        public static void Main2(string[] args)
        {
            Tortoise.SetSpeed(10);
            Tortoise.SetX(200);
            var heigthOfHouse = 40;

            Tortoise.SetPenColor("LightGray");
            DrawHouse(heigthOfHouse);

            heigthOfHouse = 120;
            DrawHouse(heigthOfHouse);

            //DrawHouse(120);
            DrawHouse(90);
            DrawHouse(20);
        }
Beispiel #16
0
        public static void Start()
        {
            Tortoise.Show();
            Tortoise.SetSpeed(10);
            var side = 2;

            for (int i = 0; i < 75; i++)
            {
                //     Set the current pen color to yellow --#6.1
                Tortoise.SetPenColor(Colors.Yellow);
                //     Use the current pen color for the line the tortoise draws --#6.2
                side++;
                Tortoise.Move(side);
                Tortoise.SetX(555);
                Tortoise.SetY(65);
                Tortoise.Turn(360.0 / 3);
                Tortoise.Turn(1);
            }
        }
Beispiel #17
0
        public static void Main()
        {
            Tortoise.Show();
            Tortoise.SetSpeed(10);

            var sides = MessageBox.AskForInput("How many sides?");

            for (int spins = 1; spins < sides; spins++)
            {
                for (int i = 0; i < sides; i++)
                {
                    Tortoise.SetPenColor(Colors.GetRandomColor());
                    Tortoise.Move(100);
                    Tortoise.Turn((360.0 * spins) / sides);
                }

                System.Threading.Thread.Sleep(100);
                //ProgramWindow.Clear();
                Tortoise.Show();
            }
        }
Beispiel #18
0
 private static void changingthepencolortogreen()
 {
     Tortoise.SetPenColor("Green");
     Homework.CheckAnswer(Tortoise.GetPenColor(), equals, "Green");
 }
Beispiel #19
0
 private static void CreateSide()
 {
     Tortoise.SetPenColor(Colors.GetRandomColor());
     Tortoise.Move(50);
     Tortoise.Turn(90);
 }
Beispiel #20
0
 private static void question3()
 {
     Tortoise.SetPenColor("yellow");
 }
Beispiel #21
0
        public static void Main()
        {
            //	Show the tortoise --#1
            Tortoise.Show();
            Tortoise.SetSpeed(4);

            //  Make the tortoise move as fast as possible  --#6

            //  Do the following 4 times --#5.1

            //     Change the color of the line the tortoise draws to blue --#4
            Tortoise.SetPenColor(GetRandomColorName());
            //     Move the tortoise 50 pixels --#2
            Tortoise.Move(150);
            //     Turn the tortoise 90 degrees to the right --#3

            Tortoise.SetSpeed(6);

            for (int i = 0; i < 10; i++)
            {
                // Turn 10%
                Tortoise.Turn(9);
                //  Repeat --#5.2
                Tortoise.SetPenColor(GetRandomColorName());
                Tortoise.Move(10);
            }

            Tortoise.Turn(90);
            Tortoise.SetPenColor(GetRandomColorName());
            Tortoise.Move(260);


            Tortoise.Turn(90);
            Tortoise.SetSpeed(8);
            Tortoise.Move(3);
            Tortoise.Turn(90);
            Tortoise.SetPenColor(GetRandomColorName());
            Tortoise.Move(254);
            Tortoise.Turn(-90);
            Tortoise.SetPenColor(GetRandomColorName());

            for (int i = 0; i < 10; i++)
            {
                // Turn 10%
                Tortoise.Turn(-9);
                //  Repeat --#5.2
                Tortoise.Move(10);
                Tortoise.SetSpeed(10);
                Tortoise.SetPenColor(GetRandomColorName());
            }

            Tortoise.Move(135);
            Tortoise.Turn(90);
            Tortoise.Move(12);
            Tortoise.Turn(180);
            Tortoise.Move(65);
            Tortoise.SetSpeed(12);
            Tortoise.SetPenColor(GetRandomColorName());
            Tortoise.Turn(90);
            Tortoise.Move(52);
            Tortoise.Turn(270);
        }