Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson3-5-2_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
636c314d
authored
4 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
f9b6bca9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
130 additions
and
7 deletions
bug.py
ds.py
bug.py
View file @
636c314d
# 悟空想画个六芒星魔法阵,主要的代码已写出,但这有bug,请你帮忙调试下~
import
turtle
import
turtle
pen
=
turtle
.
Pen
()
screen
=
turtle
.
Screen
()
size
=
textinput
(
"提示"
,
"你想要多大的魔法阵呀?"
)
screen
.
bgcolor
(
"light blue"
)
pen
.
circle
(
size
)
pen
.
circle
(
size
,
360
,
3
)
pen
=
turtle
.
Pen
()
pen
.
circle
(
size
,
60
)
pen
.
color
(
"red"
)
pen
.
circle
(
size
,
360
,
3
)
pen
.
pensize
(
5
)
# 画爱心
def
love
(
len
):
pen
.
left
(
45
)
pen
.
forward
(
2
*
len
)
pen
.
circle
(
len
,
180
)
pen
.
right
(
90
)
pen
.
circle
(
len
,
180
)
pen
.
forward
(
2
*
len
)
size
=
float
(
turtle
.
textinput
(
"提示2"
,
"你想画多大的爱心呢?"
))
pen
.
fillcolor
(
"red"
)
pen
.
begin_fill
()
love
(
size
)
pen
.
end_fill
()
pen
.
hideturtle
()
# 写文字
pen1
=
turtle
.
Pen
()
pen1
.
pencolor
(
"purple"
)
pen1
.
penup
()
pen1
.
goto
(
-
100
,
-
100
)
text
=
turtle
.
textinput
(
"提示2"
,
"你想写点什么?"
)
pen1
.
write
(
text
,
font
=
(
"Times"
,
18
,
"normal"
))
pen1
.
hideturtle
()
turtle
.
done
()
turtle
.
done
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ds.py
0 → 100644
View file @
636c314d
import
turtle
import
time
# import time
t
=
turtle
.
Turtle
()
t
.
speed
(
30
)
# 设置初始位置
t
.
penup
()
t
.
left
(
90
)
t
.
fd
(
200
)
t
.
pendown
()
t
.
right
(
90
)
# 花蕊
t
.
fillcolor
(
"red"
)
t
.
begin_fill
()
t
.
circle
(
10
,
180
)
t
.
circle
(
25
,
110
)
t
.
left
(
50
)
t
.
circle
(
60
,
45
)
t
.
circle
(
20
,
170
)
t
.
right
(
24
)
t
.
fd
(
30
)
t
.
left
(
10
)
t
.
circle
(
30
,
110
)
t
.
fd
(
20
)
t
.
left
(
40
)
t
.
circle
(
90
,
70
)
t
.
circle
(
30
,
150
)
t
.
right
(
30
)
t
.
fd
(
15
)
t
.
circle
(
80
,
90
)
t
.
left
(
15
)
t
.
fd
(
45
)
t
.
right
(
165
)
t
.
fd
(
20
)
t
.
left
(
155
)
t
.
circle
(
150
,
80
)
t
.
left
(
50
)
t
.
circle
(
150
,
90
)
t
.
end_fill
()
# 花瓣1
t
.
left
(
150
)
t
.
circle
(
-
90
,
70
)
t
.
left
(
20
)
t
.
circle
(
75
,
105
)
t
.
setheading
(
60
)
t
.
circle
(
80
,
98
)
t
.
circle
(
-
90
,
40
)
# 花瓣2
t
.
left
(
180
)
t
.
circle
(
90
,
40
)
t
.
circle
(
-
80
,
98
)
t
.
setheading
(
-
83
)
# 叶子1
t
.
fd
(
30
)
t
.
left
(
90
)
t
.
fd
(
25
)
t
.
left
(
45
)
t
.
fillcolor
(
"green"
)
t
.
begin_fill
()
t
.
circle
(
-
80
,
90
)
t
.
right
(
90
)
t
.
circle
(
-
80
,
90
)
t
.
end_fill
()
t
.
right
(
135
)
t
.
fd
(
60
)
t
.
left
(
180
)
t
.
fd
(
85
)
t
.
left
(
90
)
t
.
fd
(
80
)
# 叶子2
t
.
right
(
90
)
t
.
right
(
45
)
t
.
fillcolor
(
"green"
)
t
.
begin_fill
()
t
.
circle
(
80
,
90
)
t
.
left
(
90
)
t
.
circle
(
80
,
90
)
t
.
end_fill
()
t
.
left
(
135
)
t
.
fd
(
60
)
t
.
left
(
180
)
t
.
fd
(
60
)
t
.
right
(
90
)
t
.
circle
(
200
,
60
)
time
.
sleep
(
5
)
turtle
.
done
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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