Exemplo n.º 1
0
        public override void MoveTurtle(string instructions, float distanceUnit)
        {
            ExpressiveRangeLogger.RecordPosition();
            for (int i = 0; i < instructions.Length; i++)
            {
                switch (instructions[i])
                {
                case '0':
                    Turtle.Forward(distanceUnit / 2);
                    break;

                case '1':
                    Turtle.Forward(distanceUnit);
                    break;

                case '[':
                    PushTurtle();
                    Turtle.Rotate(-45);
                    break;

                case ']':
                    PopTurtle();
                    Turtle.Rotate(45);
                    break;
                }
                ExpressiveRangeLogger.RecordPosition();
                ProgressBar.Value = i;
            }
            base.MoveTurtle(instructions, distanceUnit);
        }
Exemplo n.º 2
0
        public override void MoveTurtle(string instructions, float distanceUnit)
        {
            ExpressiveRangeLogger.RecordPosition();
            for (int i = 0; i < instructions.Length; i++)
            {
                switch (instructions[i])
                {
                case 'F':
                case 'G':
                    Turtle.Forward(distanceUnit);
                    break;

                case '-':
                    Turtle.Rotate(120);
                    break;

                case '+':
                    Turtle.Rotate(-120);
                    break;
                }
                ExpressiveRangeLogger.RecordPosition();
                ProgressBar.Value = i;
            }
            base.MoveTurtle(instructions, distanceUnit);
        }
Exemplo n.º 3
0
        public override void MoveTurtle(string instructions, float distanceUnit)
        {
            ExpressiveRangeLogger.RecordPosition();
            for (int i = 0; i < instructions.Length; i++)
            {
                switch (instructions[i])
                {
                case 'A':
                    Turtle.Forward(distanceUnit);
                    break;

                case 'B':
                    Turtle.PenVisible = false;
                    Turtle.Forward(distanceUnit);
                    Turtle.PenVisible = true;
                    break;
                }
                ExpressiveRangeLogger.RecordPosition();
                ProgressBar.Value = i;
            }
            base.MoveTurtle(instructions, distanceUnit);
        }