From 3b61659fde89b1bbb505ca0954779cb68cdb3148 Mon Sep 17 00:00:00 2001 From: grace-xing6 Date: Sun, 6 Oct 2024 16:13:56 -0400 Subject: [PATCH] updated about spider web --- __pycache__/spiderweb.cpython-310.pyc | Bin 0 -> 1561 bytes drawing.py | 45 +++----------------------- 2 files changed, 5 insertions(+), 40 deletions(-) create mode 100644 __pycache__/spiderweb.cpython-310.pyc diff --git a/__pycache__/spiderweb.cpython-310.pyc b/__pycache__/spiderweb.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7ed932e1f9abe3c840123bca62e774414e76e568 GIT binary patch literal 1561 zcmZ8hO^+Kj7`8nhnaw8Ywp4|JKy#rG4jWaVA^}1b-D~$kxvYR_I`+=aCYhPF9YR-$ zga|)?pHR4Q;RpH3DHpCtNU%JwlTEYC$RF=(`}O1JeeAm1Z8Ln6KSl9-%-A1f?0y2q zV-)i>D#;`tvuEp;Z(8w;6)X#+kik#vB$T0y&_*(rEwr&rzh3vR`nQCu6y z(6`%J7kiQ+essM0_1~+j)wc+~iV&wjVeE%TkNcquPRB1?q_e6}?lq~i+0dwBqAIK8 za9majV`Xt>`@-#;QmWxtRfRosAsN3h-9ezgpANn5it!xQ`+ z9{!_yaNHn^h}x3%1&ldpc#AD~!4`su+t3wQK1UyP2};0RybNr(WWT_3(YDdcU@oXH z1&9kSKRyCLlV&MVkjrYq<1~CCjO*LNUn2aPFkB`pNMtU z#WJ0sx`kqhs6>QdE#Wcm;rC-X+&8`emKPc=cqKF$fQRt%-KYM5+4^{CX8l?7sn$?R zIVa8;A%E1@nl0L}#19PZrb{ zKARsdkV_f74*MQu8Pj>G=6cT&eHv@O+0@;?y1FYj9g_yaTVf zhpH2FkpB0D;ITM>2<~w4S9qo0#?Xx`M35*Up7cBDSdi(7;r^|nw}c<}g};1$d7pcc z{vS$meSr@V#L)Q?-sYMBl|N&bq_mQ*(%N@pG|5x9jnjjkme171W*YN1?s(IKM9kAB#Hs^KMq@8 AC;$Ke literal 0 HcmV?d00001 diff --git a/drawing.py b/drawing.py index 80a98a4..3c244bf 100644 --- a/drawing.py +++ b/drawing.py @@ -6,44 +6,9 @@ from turtle import * from superturtle import * +from superturtle.movement import * +from spiderweb import * -def draw_web(radius, lines): - web_turtle = Turtle() - web_turtle.speed(0) # Set the speed to the fastest - for _ in range(lines): - web_turtle.penup() - web_turtle.goto(0, 0) - web_turtle.pendown() - web_turtle.forward(radius) - web_turtle.backward(radius) - web_turtle.right(360 / lines) - -def draw_spider(size): - spider_turtle = SuperTurtle() - spider_turtle.penup() - spider_turtle.goto(0, -size * 0.5) # Position the spider at the center bottom of the web - spider_turtle.pendown() - # Draw the body - spider_turtle.begin_fill() - spider_turtle.circle(size) - spider_turtle.end_fill() - # Draw legs - angles = [45, 135, 225, 315] - for angle in angles: - spider_turtle.penup() - spider_turtle.goto(0, -size * 0.5) - spider_turtle.setheading(angle) - spider_turtle.pendown() - spider_turtle.forward(size) - spider_turtle.backward(size) - -# Setup the screen -screen = Screen() -screen.bgcolor("white") - -# Draw the web and spider -draw_web(100, 12) # radius of 100 and 12 lines -draw_spider(20) # spider size of 20 - -# Finish up -screen.mainloop() # This is better for some environments than turtle.done() \ No newline at end of file +draw_web(400) +hideturtle() +done()