Question

Draw 15 triangles in a row by using turtle graphics

Draw 15 triangles in a row by using turtle graphics
0 0
Add a comment Improve this question Transcribed image text
Answer #1

clearscreen

To Triangle
right 30 forward 30
right 120 forward 30
right 120 forward 30
right 180 forward 30 left 90
END

repeat 15 [Triangle]

Sample Output:

Code Explination:

clearscreen --> This will clear any previous outputs from the screen

To Triangle

//The 3 lines will draw the triangle
right 30 forward 30 (Turn 30 degrees righ and then draw a line of 30 pixcels)
right 120 forward 30(Turn 120 degress right and draw a line of 30 pixcels)
right 120 forward 30(Turn 120 degress right and draw a line of 30 pixcels)

//the below line sets the cursor to the position on which next triangle need to be drawn
right 180 forward 30 left 90
END

//The Triangle method is repeated 15 times to draw 15 triangles.

repeat 15 [Triangle]

Add a comment
Know the answer?
Add Answer to:
Draw 15 triangles in a row by using turtle graphics
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT