Ejemplo n.º 1
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);
            }
        }
Ejemplo n.º 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
            }
        }
Ejemplo n.º 3
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);
                }
            }
        }
Ejemplo n.º 4
0
        private static void thetortoiseturns15twice()
        {
            var ans = 15;

            Tortoise.Turn(ans);
            Tortoise.Turn(ans);
            Homework.CheckAnswer(Tortoise.GetAngle(), equals, 30);
        }
Ejemplo n.º 5
0
        private static void thetortoiseturns15twice()
        {
            var ans = ___;

            Tortoise.Turn(ans);
            Tortoise.Turn(ans);
            Homework.CheckAnswer(30, equals, Tortoise.GetAngle());
        }
Ejemplo n.º 6
0
 private static void DrawOctagonWithOverlap()
 {
     for (int i = 0; i < 8 + 1; i++)
     {
         Tortoise.Move(110);
         Tortoise.Turn(360.0 / 8);
     }
 }
Ejemplo n.º 7
0
 private static void DrawTriangle(int length)
 {
     for (int i = 0; i < 3; i++)
     {
         Tortoise.Turn(360.0 / 3);
         Tortoise.Move(length);
     }
 }
Ejemplo n.º 8
0
 private static void MoveToTheSquareStart(double length)
 {
     Tortoise.PenUp();
     Tortoise.Move(length / 2);
     Tortoise.Turn(-90);
     Tortoise.Move(length / 2);
     Tortoise.Turn(180);
     Tortoise.PenDown();
 }
Ejemplo n.º 9
0
 public static void Main2()
 {
     Tortoise.Show();
     Tortoise.SetSpeed(10);
     for (int i = 0; i < 4; i++)
     {
         DrawSquare();
         Tortoise.Turn(90);
     }
 }
Ejemplo n.º 10
0
        public static void DrawTriangle(double lineLength)
        {
            Console.WriteLine(lineLength);

            for (int i = 0; i < 3; i++)
            {
                Tortoise.Move(lineLength);
                Tortoise.Turn(360.0 / 3);
            }
        }
Ejemplo n.º 11
0
 public static void WeaveOneLayer(double lineLength, double zoom)
 {
     lineLength = lineLength + zoom;
     for (int i = 0; i < 6; i++)
     {
         DrawTriangle(lineLength);
         Tortoise.Turn(360.0 / 6);
         //lineLength = lineLength + zoom;
     }
 }
Ejemplo n.º 12
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);
     }
 }
Ejemplo n.º 13
0
 private static void DrawLowerBranches(int currentBranchLength)
 {
     Tortoise.Turn(30);
     DrawShorterBranch(currentBranchLength);
     Tortoise.Turn(-60);
     DrawShorterBranch(currentBranchLength);
     Tortoise.Turn(30);
     AdjustColor(currentBranchLength);
     Tortoise.Move(-currentBranchLength);
 }
Ejemplo n.º 14
0
 private static void MoveBackToCenter(double length)
 {
     Tortoise.PenUp();
     Tortoise.Turn(90);
     Tortoise.Move(length / 2);
     Tortoise.Turn(90);
     Tortoise.Move(length / 2);
     Tortoise.Turn(180);
     Tortoise.PenDown();
 }
Ejemplo n.º 15
0
 private static void DrawHouse(int heigthOfHouse)
 {
     Tortoise.Move(heigthOfHouse);
     Tortoise.Turn(90);
     Tortoise.Move(30);
     Tortoise.Turn(90);
     Tortoise.Move(heigthOfHouse);
     Tortoise.Turn(-90);
     Tortoise.Move(20);
     Tortoise.Turn(-90);
 }
Ejemplo n.º 16
0
 private static void DrawPentagon()
 {
     for (int i = 0; i < 200; i++)
     {
         AdjustPen();
         var length = i;
         Tortoise.Move(length);
         Tortoise.Turn(360.0 / 5);
         Tortoise.Turn(1);
     }
 }
Ejemplo n.º 17
0
        public void Question4()
        {
            //  If the Y position of tortoise is greater than 50
            //  Turn the tortoise 177 degrees to the left

            var y = Tortoise.GetY();

            if (y > 50)
            {
                Tortoise.Turn(-177);
            }
        }
Ejemplo n.º 18
0
        public void Question1()
        {
            //  If the Y position of the tortoise is 115
            //  Turn the tortoise to the right 63 degrees

            var y = Tortoise.GetY();

            if (y == 115)
            {
                Tortoise.Turn(63);
            }
        }
Ejemplo n.º 19
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);
 }
Ejemplo n.º 20
0
 public static void Start()
 {
     Tortoise.Show();
     Tortoise.SetSpeed(10);
     Tortoise.SetPenWidth(3);
     CreateColorPalette();
     for (int i = 0; i < 15; i++)
     {
         DrawOctogon();
         Tortoise.Turn(360.0 / 15);
     }
 }
Ejemplo n.º 21
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);
            }
        }
Ejemplo n.º 22
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);
     }
 }
Ejemplo n.º 23
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);
            }
        }
Ejemplo n.º 24
0
        public void Question2()
        {
            //  If the X position of tortoise is less than Y position of tortoise
            //  Turn the tortoise 54 degrees to the left
            //  Otherwise turn the tortoise 22 degrees to the right

            var x = Tortoise.GetX();
            var y = Tortoise.GetY();

            if (x < y)
            {
                Tortoise.Turn(-54);
            }
            else
            {
                Tortoise.Turn(22);
            }
        }
Ejemplo n.º 25
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);
            }
        }
Ejemplo n.º 26
0
 public static void Main2(String[] args)
 {
     setUpPyramidLand();
     Tortoise.Turn(-90);
     Tortoise.Move(220);
     Tortoise.Turn(+135);
     Tortoise.Move(100);
     Tortoise.Turn(90);
     Tortoise.Move(100);
     Tortoise.Turn(-90);
     Tortoise.Move(100);
     Tortoise.Turn(+90);
     Tortoise.Move(100);
     Tortoise.Turn(-90);
     Tortoise.Move(100);
     Tortoise.Turn(+90);
     Tortoise.Move(100);
     Tortoise.Turn(+135);
     Tortoise.Move(210);
 }
Ejemplo n.º 27
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();
            }
        }
Ejemplo n.º 28
0
 public static void Start()
 {
     Tortoise.Show();
     Tortoise.SetX(150);
     Tortoise.SetY(200);
     //Tortoise.SetSpeed(10);
     Tortoise.InstantSpeed(true);
     for (int i = 0; i < 360; i++)
     {
         Tortoise.Move(3);
         Tortoise.Turn(1);
         if (i % 20 == 0)
         {
             for (int j = 0; j < 360; j++)
             {
                 Tortoise.Move(1);
                 Tortoise.Turn(1);
                 Tortoise.SetPenWidth((j + 100) / 100);
             }
         }
     }
 }
Ejemplo n.º 29
0
        private static void MakeASquare(double length)
        {
            if (length > 10)
            {
                MoveToTheSquareStart(length);


                for (int i = 0; i < 4; i++)
                {
                    Tortoise.Move(length);
                    var newLength = length / 1.7;
                    MakeASquare(newLength);

                    if (i < 3)
                    {
                        Tortoise.Turn(90);
                    }
                }

                MoveBackToCenter(length);
                length *= 2;
            }
        }
Ejemplo n.º 30
0
 private static void thetortoiseturns21()
 {
     Tortoise.Turn(21);
     Homework.CheckAnswer(Tortoise.GetAngle(), equals, 21);
 }