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
177dc161
authored
Aug 22, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
4a48eca4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
78 deletions
.vscode/def.py
my_tree.py
.vscode/def.py
deleted
100644 → 0
View file @
4a48eca4
import
turtle
import
random
pen
=
turtle
.
Turtle
()
pen
.
color
(
'sienna'
)
turtle
.
tracer
(
False
)
pen
.
speed
(
0
)
# 画布大小
w
=
turtle
.
Screen
()
w
.
bgcolor
(
'wheat'
)
# wheat小麦
# 移动到起点
pen
.
left
(
90
)
pen
.
up
()
pen
.
backward
(
100
)
# 后退
pen
.
down
()
def
tree
(
a
):
if
a
>=
0
:
if
a
<=
12
:
c_l
=
[
"snow"
,
"lightcoral"
]
c
=
random
.
choice
(
c_l
)
pen
.
color
(
c
)
pen
.
pensize
(
a
/
3
)
else
:
pen
.
color
(
"sienna"
)
pen
.
pensize
(
a
/
10
)
pen
.
fd
(
a
)
b
=
random
.
randint
(
0
,
30
)
c
=
random
.
randint
(
1
,
15
)
pen
.
right
(
b
)
tree
(
a
-
c
)
pen
.
left
(
2
*
b
)
tree
(
a
-
c
)
pen
.
right
(
b
)
pen
.
up
()
pen
.
backward
(
a
)
pen
.
down
()
tree
(
70
)
turtle
.
done
()
my_tree.py
deleted
100644 → 0
View file @
4a48eca4
import
turtle
import
random
pen
=
turtle
.
Turtle
()
pen
.
color
(
'sienna'
)
turtle
.
tracer
(
False
)
turtle
.
setup
(
1.0
,
1.0
,
0
,
0
)
# 画布大小
w
=
turtle
.
Screen
()
w
.
bgcolor
(
'wheat'
)
# wheat小麦
pen
.
speed
(
0
)
pen
.
left
(
90
)
pen
.
up
()
pen
.
bk
(
200
)
pen
.
down
()
def
tree
(
n
):
if
n
>=
0
:
if
n
<=
12
:
color
=
[
"puuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuujljlh,nmb "
,
"poop"
]
color
=
random
.
choice
(
color
)
pen
.
color
(
color
)
pen
.
pensize
(
n
/
3
)
else
:
pen
.
color
(
"sienna"
)
pen
.
pensize
(
n
/
10
)
pen
.
fd
(
n
)
angle
=
random
.
randint
(
0
,
30
)
length
=
random
.
randint
(
1
,
15
)
pen
.
right
(
angle
)
tree
(
n
-
length
)
pen
.
left
(
2
*
angle
)
tree
(
n
-
length
)
pen
.
right
(
angle
)
pen
.
up
()
pen
.
backward
(
n
)
pen
.
down
()
tree
(
80
)
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