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
0d211972
authored
Apr 24, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
a075876f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
my_tree.py
my_tree.py
View file @
0d211972
...
...
@@ -12,4 +12,27 @@ pen.up()
pen
.
backward
(
150
)
# 后退
pen
.
down
()
pen
.
forward
(
100
)
#画右边树枝并返回
pen
.
right
(
30
)
pen
.
forward
(
50
)
pen
.
up
()
pen
.
backward
(
50
)
pen
.
down
()
#画左边树枝并返回
pen
.
left
(
60
)
pen
.
forward
(
50
)
pen
.
up
()
pen
.
backward
(
50
)
pen
.
down
()
#树干返回
pen
.
right
(
30
)
pen
.
up
()
pen
.
backward
(
106
)
pen
.
down
()
turtle
.
done
()
#请控制画笔,画出一段树权(二叉树),
# 要求:1、树干的长度为100,左右两边的树枝长度为50,并且与树干的角度是150
# 2、画笔画完树极后,要按原路退回来,并且朝上
# 提示:树干与树枝组成的角是150,那么它们的夹角就是30°,所以画笔完树干部分后,
# 需要先向右(左)旋转30°,画完一边的树枝,退回来后,需要向另一边旋转双的角度,才能画另一边的树枝哦!
\ No newline at end of file
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