00:01
We're going to draw five shapes, a triangle, square, pentagon, hexagon, and octagon.
00:05
Obviously, we're going to import our turtle module, and i'm going to set a variable for side length.
00:11
It's going to be the same for all of them, so i'll just make it 40.
00:16
And then i want to set my pen size as well.
00:21
So pen size, and i'll do three.
00:28
So let's do the triangle.
00:30
So for this, we're just going to do a pen up because we want to move to the starting position without drawing.
00:40
Pen up.
00:41
And then, so now we're going to tell it to go to, i just decided to do negative 200 and negative 50 in the y.
00:54
It's just something you can play around with until it looks right.
00:56
I didn't do it for any specific reason other than to give space for the rest of the shapes.
01:02
And then now we can start drawing.
01:05
Tell the pen to get down on the paper.
01:10
And this i'm going to fill.
01:13
So eternal dot begin, fill.
01:21
And let's give it some color.
01:26
I'm going to do red for the triangle.
01:31
And i want to set the heading because i want i want a side on all of these shapes to be flat with the x -axis.
01:39
So i'm going to need to know those angles for all the shapes, which conveniently i just looked up.
01:46
So we want to set the heading for the triangle to be flat and if i set the heading to 60 because the interior angles of the triangle equal lateral triangle is 30 degrees is 60 degrees i'm sorry so if i set the heading to 60 then it's going to make sure that that first side is flat and then we will draw a triangle but actually a circle because circles are just a bunch of small sides anyway we're just going to tell the program that we're drawing a circle of this many sides specifically so it's side length and we're going to do steps of three so that's three sides and that's going to give us a triangle so then we can just end the fill well i'm having trouble typing here sorry so so there's our triangle.
02:55
Now this code is going to be essentially the same for everything else except for the starting position, the color i'm going to change, and the heading, and then of course the steps.
03:07
So i have conveniently copied and pasted a blank shell of that.
03:12
So the square, again, we're going to move the pen to start drawing the square.
03:17
And we're going to go to the square...