1
00:00:00,390 --> 00:00:03,480
All right. Onwards to the next turtle challenge.

2
00:00:03,990 --> 00:00:06,960
So this one is going to be a little bit more intensive,

3
00:00:06,990 --> 00:00:08,880
but still a bit of a warmup.

4
00:00:08,910 --> 00:00:13,910
So we're just going to go for a light jog and we're going to draw a dashed line.

5
00:00:15,150 --> 00:00:18,720
You're going to get your turtle to draw a line like this

6
00:00:19,050 --> 00:00:24,000
where it's going to draw a line for 10 paces and then a gap of 10 paces,

7
00:00:24,360 --> 00:00:26,400
and then a solid line for 10 paces again

8
00:00:26,400 --> 00:00:30,150
and it's going to repeat this until it does this 50 times.

9
00:00:30,720 --> 00:00:33,270
The actual length of the line doesn't really matter,

10
00:00:33,630 --> 00:00:37,260
the actual length of each of the sections doesn't really matter.

11
00:00:37,260 --> 00:00:41,580
What's really important is you're able to get this alternating draw-

12
00:00:41,580 --> 00:00:44,850
no-draw thing going on. To complete this challenge

13
00:00:44,880 --> 00:00:49,880
you're going to need to look through the documentation and maybe also use the

14
00:00:50,760 --> 00:00:55,230
help of Google or Stack Overflow and figure out how you can get this behavior to

15
00:00:55,230 --> 00:01:00,090
happen. Have a think about it and pause the video and complete the challenge.

16
00:01:03,000 --> 00:01:06,330
All right. So if we look through the table of contents here,

17
00:01:06,720 --> 00:01:11,550
we can see that the thing that controls the pen is in this section.

18
00:01:11,670 --> 00:01:15,660
We can control it's drawing, color, filling and more.

19
00:01:16,080 --> 00:01:18,960
Now if we look at the drawing control you can see

20
00:01:18,960 --> 00:01:23,790
we can get it to pen down and pen up. When we pull the pen down,

21
00:01:23,970 --> 00:01:27,450
that means the pen is on the paper and it's going to make a mark.

22
00:01:27,840 --> 00:01:32,370
But when the pen is pulled up, then there's going to be no drawing happening

23
00:01:32,610 --> 00:01:34,740
when our turtle is moving.

24
00:01:35,700 --> 00:01:39,270
That means we can write some sort of loop, right?

25
00:01:39,270 --> 00:01:44,070
Where we get our turtle to move forwards by 10 paces

26
00:01:44,640 --> 00:01:48,720
and then we can get this to pull the pen up.

27
00:01:49,620 --> 00:01:54,300
And what this is going to do is allow us to move forwards without drawing.

28
00:01:54,720 --> 00:01:59,220
So now, while the pen is held up we're going to go forwards. Once more

29
00:01:59,310 --> 00:02:03,420
another 10 paces this is going to draw the blank. And then finally,

30
00:02:03,420 --> 00:02:06,000
we're gonna go ahead and put the pen down again.

31
00:02:07,890 --> 00:02:12,890
So now, all we need is for these four steps to repeat 15 times so we can write a

32
00:02:15,780 --> 00:02:20,280
for loop and then create a range that goes from 0 to 15.

33
00:02:20,730 --> 00:02:25,730
And then once we indent this block inside the for loop and run our code,

34
00:02:26,430 --> 00:02:29,340
then you can see it draw our dashed line.

35
00:02:30,030 --> 00:02:31,620
Did you manage to get this solution?

36
00:02:31,980 --> 00:02:36,420
Did you manage to find the relevant part of the documentation to be able to pull

37
00:02:36,420 --> 00:02:41,420
the pen up and put the pen down, or did you simply change your code so that it

38
00:02:41,790 --> 00:02:45,840
drew black and then it drew white? All of these solutions would work,

39
00:02:45,930 --> 00:02:50,930
but what I really wanted you to do is to dig through the documentation and find

40
00:02:51,540 --> 00:02:54,360
the parts which will help you to achieve your goals.

41
00:02:55,710 --> 00:02:57,000
Head over to the next lesson

42
00:02:57,120 --> 00:03:00,180
and I've got another slightly harder challenge for you.

