Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson15-diy1
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
78e95eb8
authored
Sep 30, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
814b8f0f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
my_tree.py
my_tree.py
View file @
78e95eb8
...
...
@@ -6,19 +6,24 @@ pen.color('sienna')
w
=
turtle
.
Screen
()
w
.
bgcolor
(
'wheat'
)
# wheat小麦
pen
.
goto
(
0
,
0
)
# 移动到起点
pen
.
left
(
90
)
pen
.
forward
(
100
)
pen
.
left
(
30
)
pen
.
forward
(
50
)
pen
.
up
()
pen
.
backward
(
50
)
# 后退
pen
.
down
()
pen
.
right
(
60
)
pen
.
forward
(
50
)
pen
.
up
()
pen
.
backward
(
50
)
# 后退
pen
.
left
(
30
)
pen
.
backward
(
100
)
def
tree
(
n
):
if
n
>=
50
:
pen
.
forward
(
n
)
pen
.
right
(
30
)
tree
()
# pen.goto(0,0)# 移动到起点
# pen.left(90)
# pen.forward(100)#画树干
# pen.left(30)
# pen.forward(50)#画左边树枝并返回
# pen.up()
# pen.backward(50) # 后退
# pen.down()
# pen.right(60)
# pen.forward(50)#画右边树枝并返回
# pen.up()
# pen.backward(50) # 后退
# pen.left(30)
# pen.backward(100)#树干返回
turtle
.
done
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment