2013-11-02 72 views
0

好吧,我想繪製傑克o'燈籠,其中應包括一個綠色的莖橙色身體兩個眼睛一個鼻子一張嘴 現在我知道我必須使用以下 Circle +多邊形+矩形把它完成,這裏是我已經開始繪製傑克ö在蟒蛇燈籠

def hal(): 
win = GraphWin("My Circle", 200, 200) 
c = Circle(Point(100,100), 50) 
c.setFill("Orange") 
c.draw(win) 
p1 = 50 
p2 = 40 
p3 = 50 
eye= Polygon(p1,p2,p3) ###here is my problem, I could not get it, how can I center 

它的圈子裏面,所以我可以做的眼睛, 喜歡什麼,我不得不使用這樣的數字我 可以把它裏面的圈子,我怎麼能這個數字, ,所以我可以知道如何去做

eye.setFill("Red") 
eye.draw(win) 
win.getMouse() 

也爲矩形,我怎麼知道如何將它放置在圓的頂部,有什麼方法可以知道嗎?

謝謝

我使用python 3.3 這個圖形庫 http://mcsp.wartburg.edu/zelle/python/graphics.py

+1

編程語言?標記語言?圖形庫?一般來說,如果你不告訴人們你使用的是哪一種,他們無法幫助你。 –

+0

Python 3.3和這個庫http://mcsp.wartburg.edu/zelle/python/graphics.py – CaVeMaN

+1

然後,您可能想要將此問題標記爲Python,以便將其突出顯示給喜歡該標記的人。我不知道足夠的Python來幫助你,但標記這可能會讓別人去幫助你。 –

回答

0

好吧,我得到了它,它只是我不得不改變這裏的數字是有也有一些描述代碼

enter code heredef pumpkin(): 
win = GraphWin("My Circle", 800,600) 
c = Circle(Point(400,400),200) 
c.setFill("Orange") 
c.draw(win) 
eye= Polygon(Point(500,270), Point(430,400), Point(550,400)) 
eye.setOutline("yellow") 
eye.setFill("Red") 
eye.draw(win) #lesgoleft,#les=up,lessgoleft 
reye= Polygon(Point(250,280), Point(230,400), Point(350,400)) 
reye.setOutline("yellow") 
reye.setFill("Red") 
reye.draw(win)#moreright 
moth=Polygon(Point(250,500), Point(450,540), Point(370,500)) 
moth.setOutline("yellow") 
moth.setFill("Red") 
moth.draw(win)        #moregoright 
nose=Polygon(Point(380,400), Point(340,480), Point(500,480)) 
nose.setOutline("yellow") 
nose.setFill("Red") 
nose.draw(win) 
up= Rectangle(Point(360,200),Point(430,100)) 
up.setFill("dark green") 
up.draw(win) 
win.getMouse() 
win.close()