2. SQUARE
To Make a Different
sized square either up
or down the FD
number
As you can see I also experimented with the back ground color and the turtles color to do this
simply enter SETC “YELLOW or the color you want your lines to be for the background color you
enter SETBG “BLACK or the color that you want. [Warning purple does not work use violet
instead].
Any commands within brackets can be repeated by putting
the command “repeat” and a figure after it stating how
many times you want it to be repeated. A square has four
sides so I needed the turtle to move forward as many
pixels as I wanted. I chose 50 pixels. A square has equal
sides and equal angles. The angles are always 90 degrees.
Therefore the turtle needs to move forward 50 pixels and
then turn 90 degrees, four times to create a square. That
is why I put “repeat 4” because the command needed to be
repeated 4 times for each of the four sides.
3. RECTANGLE
For these colors I used
cyan for the lines and
pink for the background
A rectangle is a quadrilateral with four 90 degree angles,
which are also called right angles. It has two parallel sides
which are the same length and another two parallel sides
which are a different length. Two of the sides
perpendicular to each other need to be repeated, which
means we only need to repeat the commands two times. I
chose to move forward 100 pixels for the longer sides of
the rectangle and 50 pixels for the smaller sides. The
turtle needed to move 100 pixels, turn right 90 degrees,
then move forward 50 pixels, then turn right 90 degrees
again. This then needed to be repeated two times, so I
put the first commands in brackets and then put “repeat
2” in front of them.
4. ISOSCELES TRIANGLE
An Isosceles triangle has two angles which have the same
degrees and two sides which are the same length. I
decided to make the two equal sides of my triangle 48
pixels, so I used the command “fd 48”. I made the turtle
turn 135 degrees twice to create the same angles. These
were the outside angles of the triangle, rather than the
degrees inside. I made the third side which was different
in length to the other sides 70 pixels. It worked.
To change the
angle or degrees
the turtle moves
increase or
decrease the “rt” or
“lt” number
5. EQUILATERAL TRIANGLE
An equilateral triangle has 3 equal sides and 3
equal angles. I used outside angles to figure
out the total the total of outside angles was
360 so I then divided 360 by 3 because all the
angles are equal. This gave me the answer of
120. I chose to move forward 50 pixels and
then turn right 120 degrees. This needed to
be repeated 3 times for the 3 sides of a
triangle.
6. SCALENE TRIANGLE
A scalene triangle has 3 different angles and three sides
each different lengths. I selected 3 different sized angles
and ensured they added up to 360 degrees. To begin I told
my turtle to move forward 50 pixels, then turn right 140
degrees, to move forward 60 pixels, right turn 120
degrees, move forward 40 pixels and to turn right 100
degrees, which completed the 360 degrees of a triangle.
7. PENTAGON
A pentagon has five sides and five angles, each
angle is 72 degrees. If you divide 360 by 5 you
get 72. Any commands within brackets can be
repeated as many times as you want. Therefore
inside the brackets if I go forward 50 pixels (you
can chose more or less then 50 as this alters the
size), then either right or left turn 72 degrees for
the angle of the turn the turtle needs to make
that creates one line and one angle. When I put
the command “repeat 5” in front of the brackets,
the turtle will repeat the commands 5 times and
create a pentagon.
8. PARALLELOGRAM
A parallelogram has is a quadrilateral but does not have
right angles. It is like a sloped rectangle. It has two
opposite angles that are the same in each corner. I moved
my turtle forward 70 pixels, then made it turn right 45
degrees, then forward 50 pixels, right 135 degrees, forward
70 pixels, right turn 45 degrees and finally forward 50
pixels. Even though a parallelogram has some of the same
angles and lengths of the sides, I couldn’t do a repeat
command because of the right turn 135 degrees in the
middle of it.
9. NONAGON & DECAGON
To nonagon and decagon I used
similar commands. The only
difference was the degrees and
the amount of repeats. A
nonagon has 9 sides so I divided
360 degrees by 9 which gave me
40 degrees. Inside by brackets I
put to forward 50 pixels, then
right turn 40. I then asked the
turtle to repeat this 9 times.
A decagon has 10 sides, so I
divided 360 by 10 which gave me
36, which meant my angles
would all be 36 degrees. Inside
the brackets I got the turtle to
move forward 50 spaces, then
turn 36 degrees. I then put in
front of the brackets to repeat
this procedure 10 times to create
a decagon.
10. PATTERN
You cannot see this, but this pattern
rotates a square which turns every 10
degrees and repeats itself for 360
degrees. I set the background to black
and the square keeps rotating and
changing colors every 360 degrees. It
changes from red, to orange, to
yellow, to green, to blue, violet and
right through all of these colors again.
The affect is stunning.
I used my previous commands for a
square and then commanded the turtle
to “square” in this program and it
already knew what a square was.
11. HOUSE AND FENCE
To create this house and fence
I first made a fence. I made
one picket and then repeated
it 8 times. I then programmed
a square and put the square at
the end of the fence and
programmed it as “to house”. I
then added a triangle to the
end of the house program.