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
0b0c9539
authored
Dec 16, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
f9b6bca9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
9 deletions
bug.py
bug.py
View file @
0b0c9539
# 悟空想画个六芒星魔法阵,主要的代码已写出,但这有bug,请你帮忙调试下~
import
turtle
pen
=
turtle
.
Pen
()
size
=
textinput
(
"提示"
,
"你想要多大的魔法阵呀?"
)
pen
.
circle
(
size
)
pen
.
circle
(
size
,
360
,
3
)
pen
.
circle
(
size
,
60
)
pen
.
circle
(
size
,
360
,
3
)
turtle
.
done
()
screen
=
turtle
.
Screen
()
#导出背景颜色
screen
.
bgcolor
(
"light blue"
)
#设置为蓝
pen
=
turtle
.
Pen
()
#导出画笔
pen
.
write
(
"l o l"
,
font
=
(
"Times"
,
30
,
"normal"
))
#写lol,lol可以换
pen
.
hideturtle
()
#画笔隐身
big
=
screen
.
textinput
(
"100"
,
"写100,不然你会骂得很难听awa"
)
#设置爱心大小和问你awa
lovesize
=
int
(
big
)
#别问为什么没注释,问就是作者也不知道它干嘛用的:(
pen1
=
turtle
.
Pen
()
#以下都是画爱心,除了我注释的
pen1
.
penup
()
#抬笔
pen1
.
goto
(
40
,
-
60
)
#换位置
pen1
.
pendown
()
pen1
.
pensize
(
5
)
pen1
.
pencolor
(
"gold"
)
#决定画笔画出来的颜色,gold可以改
pen1
.
left
(
45
)
pen1
.
forward
(
lovesize
)
pen1
.
circle
(
lovesize
/
2
,
180
)
pen1
.
right
(
90
)
pen1
.
circle
(
lovesize
/
2
,
180
)
pen1
.
forward
(
lovesize
)
pen1
.
hideturtle
()
#画笔隐身
turtle
.
done
()
#保存画布
#成功太难啦ToT不过我成功了!鼓掌!
\ 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