### 8. The pen width

Until now you have been using a pen that draws a black line the width of 1 point. The width of the line means how thick the line is. If we want to draw more beautiful things, sometimes we'll want to use a wider or narrower line, or choose a different color. The command to change the pen's width is setwidth followed by a number. The number will represent the new width of the line, counting it in points.
Set the pen width to 5.
To see the wider line we asked for, we will ask the honorable turtle to move forward a little bit.
Draw a 50-point-long line.
Let's play a little bit more with the pen width.
Set the pen to double the width of the line it drew before. Draw a line that is 60 points long.
Before continuing with the next line, let's ask the turtle to turn back diagonally. Any turn angle that the turtle will take now that is between 90 and 270 degrees will make him face backwards from his current direction.
Ask the turtle to turn 135 degrees to the left.
Let's try to draw a line with a changing width. That means a line that has different widths at different places. We will use the help of the loops you learned about before. Try to draw a line that is 100 points long that is divided into 10 lines, each 10 points long. Half of the 10-points-long lines will be three points wide and half of them will be one point wide.
Draw the requested line using only one loop.
The dashed line you have drawn on the previous step could also be the edge (line) of a dashed square. Now you can draw a dashed square, where the length of each of its edges is 100 points. Of course we will use a nested loop, just like we learned before.
Clear the screen and draw a dashed square. Use the turn left command to turn between the edges of the square.
In case you haven't notice by now, the use of the 'up' and 'down' arrow keys on your keyboard can show you the last commands you were using. Using the arrow keys and adding existing commands allows us to experiment with making small changes to the commands we give the turtle. We can see what happens and how it affects the turtle's moves. The sequence of commands we give the turtle is sometimes called a code. In the previous lesson you learned how to draw a regular octagon.
Draw a regular octagon with dashed lines. Each edge (line) of the octagon will be 100 points long.
If you didn't clear the screen between the past tasks, you will see that the square you created is not exactly in the middle of the octagon. Now we will ask you to think a little bit about how to draw a dashed square inside a dashed octagon. Keep in mind: The square should be in the exact middle of the octagon. To make it a little easier, let's say that the octagon should be moved 71 points to the right, and it would be better if you lift your pen from the board between drawing different shapes. It is not very complicated, but because you might want to try it a few times we ask that you clear the screen at the beginning of each command row. If you haven't succeeded, don't worry; on the next lesson you will learn how to make it easier.
Draw a dashed square in the middle of an octagon. First draw the square, then move the turtle. After that, draw the octagon.
{"ft_lang_label":"__label__en","ft_lang_prob":0.9483322,"math_prob":0.92678463,"size":3211,"snap":"2022-27-2022-33","text_gpt3_token_len":729,"char_repetition_ratio":0.14780168,"word_repetition_ratio":0.0,"special_character_ratio":0.22858922,"punctuation_ratio":0.0877193,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9612574,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-08-08T23:23:55Z\",\"WARC-Record-ID\":\"<urn:uuid:3abd7fa3-ea00-410d-99ab-53fe73bdc13a>\",\"Content-Length\":\"33578\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:94e35609-90c3-4e60-81d1-2830c242eee1>\",\"WARC-Concurrent-To\":\"<urn:uuid:28c7ff63-150b-47a3-9f9f-ba8e315d780c>\",\"WARC-IP-Address\":\"162.55.91.213\",\"WARC-Target-URI\":\"https://turtleacademy.com/lessons/4\",\"WARC-Payload-Digest\":\"sha1:4DLWKLPW4FUPSEJ46VWF3PXXYT5U33AH\",\"WARC-Block-Digest\":\"sha1:7R4OA3CH7E4VJ6522AZC2WP6U5EKI4PT\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-33/CC-MAIN-2022-33_segments_1659882570879.1_warc_CC-MAIN-20220808213349-20220809003349-00452.warc.gz\"}"}