Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3fadbd8

Browse files
draw a dot petern
1 parent c70ac01 commit 3fadbd8

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

‎python_turtol_graphics/dot_pattern.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import turtle
2+
3+
def draw_pattern(t, height, width, dot_distance):
4+
for i in range(height):
5+
for i in range(width):
6+
t.dot()
7+
t.forward(dot_distance)
8+
t.back(dot_distance*width)
9+
t.right(90)
10+
t.forward(dot_distance)
11+
t.left(90)
12+
13+
def draw_art():
14+
window = turtle.Screen()
15+
t = turtle.Turtle()
16+
t.speed(50)
17+
dot_distance = 10
18+
width = 20
19+
height = 20
20+
t.penup()
21+
draw_pattern(t, height, width, dot_distance)
22+
23+
24+
window.exitonclick()
25+
26+
draw_art()

‎python_turtol_graphics/piramid.py

Whitespace-only changes.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /