A reminder on how to commit:
In circleOfCircles, you must first add a Boolean test to see if the entire circleOfCircles will fit inside the window. If not, print a message to the console instead of drawing the circleOfCircles. You may consider using the getHeight and getWidth methods of the GraphWin class in solving this problem.
You should also test that N is greater than 2. If not, print an appropriate message to the console instead of drawing the circleOfCircles.
If the circleOfCircles will fit inside the window, you should be able to create some interesting patterns by calling your function with various parameters (in a 1000 by 1000 window). You might try (one at a time) the examples below, along with output from the first one.
Commit your Session10 project, with an appropriate comment, to your repository.
(40 Points) Function versions of pizza, polygon, and star. Place all of your function definitions in one Python source file, pizzaPolyStar.py, already in the Session10 project.
If n is not greater than 2, print an appropriate message to the console and do not draw the star.
If n is not odd (i.e., n is even), draw 2 stars as follows:
Note: You must still use the instructions in step e. to draw your stars.
def main(): win1 = GraphWin("Window 1", 400, 350) win2 = GraphWin("Window 2", 400, 350) pizza(win1, Point(50, 50), 40, 10) pizza(win1, Point(150, 50), 45, 3) star(win1, Point(250, 50), 35, 7, 3) polygon(win2, Point(100, 200), 75, 7) star(win2, Point(300, 200), 100, 17, 5) message = Text(Point(200, 340), "Click this window to end program.") message.draw(win1) win1.getMouse() win1.close() win2.close() main()
star()
function working, can you change the body of your
polygon()
function to just use a single line that invokes your
star()
function?