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
6aefd48c
authored
Nov 18, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
0ee7fbe5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
9 deletions
bug.py
bug.py
View file @
6aefd48c
# 悟空想画个六芒星魔法阵,主要的代码已写出,但这有bug,请你帮忙调试下~
import
turtle
import
turtle
pen1
=
turtle
.
Pen
()
pen
=
turtle
.
Pen
()
pen1
.
penup
()
size
=
textinput
(
"提示"
,
"你想要多大的魔法阵呀?"
)
pen1
.
goto
(
100
,
-
100
)
pen
.
circle
(
size
)
# \n 换行
pen
.
circle
(
size
,
360
,
3
)
pen1
.
write
(
"123457
\n
89456
\n
341132"
,
pen
.
circle
(
size
,
60
)
font
=
(
"Times"
,
10
,
"normal"
))
pen
.
circle
(
size
,
360
,
3
)
# 拿画笔
turtle
.
done
()
pen
=
turtle
.
Pen
()
# 拿背景
screen
=
turtle
.
Screen
()
# 设置背景颜色 #值=(1-9 a-f) 6位 3位 adf = aaddff
screen
.
bgcolor
(
"#abcdef"
)
# 设置画笔颜色
pen
.
color
(
"red"
)
# 设置画笔粗细
pen
.
pensize
(
10
)
# 画爱心
len
=
int
(
screen
.
textinput
(
"qwqe"
,
"adw"
))
pen
.
left
(
45
)
# 正方形边长为圆的直径:2*len
# fd = forword
pen
.
fd
(
2
*
len
)
pen
.
circle
(
len
,
180
)
pen
.
right
(
90
)
pen
.
circle
(
len
,
180
)
pen
.
fd
(
2
*
len
)
# 隐藏画笔
pen
.
hideturtle
()
# 保留画布
turtle
.
done
()
\ 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