Ch 6 Program

April 3rd, 2008

Ah, the good ol’ prof has instructed us to post something again.

Here’s a program (in python) I wrote after reading up to Ch. 6 in the textbook.
#improved_circle.py
#program demonstrating the use of multiple functions
#Patrick Connelly, CPSC 110-05

#import graphics module
from graphics import *

#define function circle
def circle(point, window):
circ = Circle(point, 50)
circ.setWidth(2)
circ.setFill(“green”)
circ.setOutline(“orange”)
circ.draw(window)

#define main function
def main():
#make a graphics window, title “make 3 circles”, 400×400 pixels
win = GraphWin(“Make three circles”, 400, 400)
#prompt user to make circles
message = Text(Point(190, 390), “click for three circle centers.”)
message.draw(win)

#use circle function to draw 3 circles at click locations
circle(win.getMouse(),win)
circle(win.getMouse(),win)
circle(win.getMouse(),win)

#exit prompt
message.setText(“click anywhere to quit.”)
#wait for a click to close
win.getMouse()
win.close()

#run the main funcion
main()

First (maybe final) post

April 1st, 2008

I have a blog because my CPSC 110 teacher said I should. However, I probably will not do anything further with it, being the lazy-ass mother-f***er i am : )

have a nice day.

Hello world!

April 1st, 2008

Welcome to UMW Blogs.org. This is your first post. Edit or delete it, then start blogging!