Esempio n. 1
0
        public Turtle Print(Turtle printer, string input, int spacing = 1)
        {
            printer.ShowTurtle = false;
            int    width  = 64;
            int    height = 64;
            Bitmap image  = (Bitmap)Image.FromFile(input, true);

            for (int i = 0; i < image.Height; i++)
            {
                for (int j = 0; j < image.Width; j++)
                {
                    Color clr = image.GetPixel(j, i);
                    printer.SetColor(clr.R, clr.G, clr.B);
                    printer.Forward(1);
                }
                printer.CaptureScreenshot();
                printer.PenUp();
                printer.Rotate(90, false);
                printer.Forward(spacing);
                printer.Rotate(90, false);
                printer.Forward(image.Width);
                printer.Rotate(-180, false);
                printer.PenDown();
            }
            printer.ShowTurtle = true;
            return(printer);
        }
Esempio n. 2
0
        /// <summary>
        /// This is the place to put your turtle code
        /// </summary>
        public Turtle ToExecute()
        {
            Turtle t = new Turtle();

            t.Rotate(-90);
            for (int i = 0; i < 6; i++)
            {
                t.StoreTurtlePosition();
                for (int e = 0; e < 20; e++)
                {
                }
                {
                    DrawSection(t, 100);
                }
                t.RestoreTurtlePosition();
                t.Rotate(60);
            }


            t.StoreTurtlePosition();



            return(t);
        }
Esempio n. 3
0
 static Turtle TurleReturn(Turtle t, int lenght, double brushSize)
 {
     t.Rotate(90, false);
     t.Forward(brushSize);
     t.Rotate(90, false);
     t.Forward(lenght);
     t.Rotate(-180, false);
     return(t);
 }
Esempio n. 4
0
 void DrawSection(Turtle t, int p)
 {
     t.Forward(10);
     t.StoreTurtlePosition();
     t.Rotate(-45);
     t.Forward(p);
     t.RestoreTurtlePosition();
     t.Rotate(45);
     t.Forward(p);
     t.RestoreTurtlePosition(true);
 }
Esempio n. 5
0
        /// <summary>
        /// This is the place to put your turtle code
        /// </summary>
        public Turtle ToExecute()
        {
            Turtle t = new Turtle();

            t.Rotate(-90);

            for (int i = 0; i < 20; i++)
            {
                DrawSection(t, 100);
            }
            return(t);
        }
Esempio n. 6
0
        void DrawSection(Turtle t, int p)
        {
            for (int i = 0; i < 10; i++)
            {
                t.Forward(2);

                t.SetColor(90 + i * 15, 170, 200);
            }
            t.StoreTurtlePosition();
            t.Rotate(-45);
            for (int i = 0; i < p; i++)
            {
                t.Forward(1);
                t.SetColor(i + 100, 0, 0);
            }
            t.SetColor(90, 170, 200);
            t.RestoreTurtlePosition();
            t.Rotate(45);
            t.Forward(p);
            t.RestoreTurtlePosition(true);
        }
Esempio n. 7
0
        /// <summary>
        /// This is the place to put your turtle code
        /// </summary>
        public Turtle ToExecute()
        {
            Turtle t = new Turtle(true);

            t.BackgroundColor = "Black";
            t.Rotate(-90);
            t.TurtleSpeed = 15;
            for (int i = 0; i < 6; i++)
            {
                t.StoreTurtlePosition();

                for (int j = 0; j < 20; j++)
                {
                    DrawSection(t, 100 - 5 * j);
                }

                t.RestoreTurtlePosition();
                t.Rotate(60);
                t.CaptureScreenshot();
            }
            return(t);
        }
Esempio n. 8
0
        public Turtle ToExecute()
        {
            Turtle     t   = new Turtle(true);
            Text       txt = new Text();
            ImagePrint prn = new ImagePrint();

            t.SetBrushSize(1);
            t.AnimatePath = false;
            t.TurtleSpeed = 50;
            t             = prn.Print(t, "image.bmp");
            t.SetColor("brown");
            t = txt.Write(t, "Želva", true, 1);
            t.Rotate(22.5);
            t.SetColor("Black");
            t = txt.Write(t, "píše!", false, 1);
            for (int i = 0; i < 14; i++)
            {
                t.Rotate(22.5);
                t = txt.Write(t, i + string.Empty, (i % 2) == 1, 1, new Font(SystemFonts.DefaultFont.FontFamily, 36, FontStyle.Underline));
            }

            return(t);
        }
Esempio n. 9
0
 void rect(int x, int y, int line)
 {
     t.MoveTo(x, y);
     t.Rotate(-90, true);
     t.Forward(line);
     t.Rotate(-90);
     t.Forward(line);
     t.Rotate(-90);
     t.Forward(line);
     t.Rotate(-90);
     t.Forward(line);
 }
Esempio n. 10
0
 void RotPos()
 {
     t.Rotate(120);
 }