ยปCore Development>Code coverage>Lib/turtledemo/peace.py

Python code coverage for Lib/turtledemo/peace.py

#countcontent
1n/a#!/usr/bin/env python3
2n/a""" turtle-example-suite:
3n/a
4n/a tdemo_peace.py
5n/a
6n/aA simple drawing suitable as a beginner's
7n/aprogramming example. Aside from the
8n/apeacecolors assignment and the for loop,
9n/ait only uses turtle commands.
10n/a"""
11n/a
12n/afrom turtle import *
13n/a
14n/adef main():
15n/a peacecolors = ("red3", "orange", "yellow",
16n/a "seagreen4", "orchid4",
17n/a "royalblue1", "dodgerblue4")
18n/a
19n/a reset()
20n/a Screen()
21n/a up()
22n/a goto(-320,-195)
23n/a width(70)
24n/a
25n/a for pcolor in peacecolors:
26n/a color(pcolor)
27n/a down()
28n/a forward(640)
29n/a up()
30n/a backward(640)
31n/a left(90)
32n/a forward(66)
33n/a right(90)
34n/a
35n/a width(25)
36n/a color("white")
37n/a goto(0,-170)
38n/a down()
39n/a
40n/a circle(170)
41n/a left(90)
42n/a forward(340)
43n/a up()
44n/a left(180)
45n/a forward(170)
46n/a right(45)
47n/a down()
48n/a forward(170)
49n/a up()
50n/a backward(170)
51n/a left(90)
52n/a down()
53n/a forward(170)
54n/a up()
55n/a
56n/a goto(0,300) # vanish if hideturtle() is not available ;-)
57n/a return "Done!"
58n/a
59n/aif __name__ == "__main__":
60n/a main()
61n/a mainloop()