Mercurial > repos > rliterman > csp2
comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/turtledemo/yinyang.py @ 68:5028fdace37b
planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author | jpayne |
---|---|
date | Tue, 18 Mar 2025 16:23:26 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
67:0e9998148a16 | 68:5028fdace37b |
---|---|
1 #!/usr/bin/env python3 | |
2 """ turtle-example-suite: | |
3 | |
4 tdemo_yinyang.py | |
5 | |
6 Another drawing suitable as a beginner's | |
7 programming example. | |
8 | |
9 The small circles are drawn by the circle | |
10 command. | |
11 | |
12 """ | |
13 | |
14 from turtle import * | |
15 | |
16 def yin(radius, color1, color2): | |
17 width(3) | |
18 color("black", color1) | |
19 begin_fill() | |
20 circle(radius/2., 180) | |
21 circle(radius, 180) | |
22 left(180) | |
23 circle(-radius/2., 180) | |
24 end_fill() | |
25 left(90) | |
26 up() | |
27 forward(radius*0.35) | |
28 right(90) | |
29 down() | |
30 color(color1, color2) | |
31 begin_fill() | |
32 circle(radius*0.15) | |
33 end_fill() | |
34 left(90) | |
35 up() | |
36 backward(radius*0.35) | |
37 down() | |
38 left(90) | |
39 | |
40 def main(): | |
41 reset() | |
42 yin(200, "black", "white") | |
43 yin(200, "white", "black") | |
44 ht() | |
45 return "Done!" | |
46 | |
47 if __name__ == '__main__': | |
48 main() | |
49 mainloop() |