0

I need to write a Python Turtle graphics program to output an n-pointed regular star, where n is an odd integer from 5 -to- 99 input by the user in answer to a question prompt.

Also, my program should NOT contain separate code for each different star


please help! ASAP!!

2
Contributors
2
Replies
5
Views
6 Years
Discussion Span
Last Post by beggers23
0

Start with code to draw a line. Next add code to calculate the angle necessary to draw a star with a given number of points. A 5 pointed star would have 10 lines and the angle would be 72 degrees for example. You would then draw a line of a fixed length, starting at point x, y at the appropriate angle. Then starting where the previous line left off, draw another line of the same length at the given angle to that line. It might be easier to start with a triangle with all angles at 6o degrees and then adjust to drawing a star. It would be interesting to try, but I don't want to do your homework for you.

Edited by zentraders: n/a

0

I need an algorithm that will write the 5 pointed, 7 pointed, 9 pointed, all the way to 99 pointed stars with out me writing a code for each star. Is there such an animal?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.