Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson3-1-1_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
e0ee11b5
authored
Mar 05, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
096721ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
94 additions
and
22 deletions
diy1.py
diy1.py
View file @
e0ee11b5
# 利用write()帮助悟空给诺依回信吧~
# 利用write()帮助悟空给诺依回信吧~
import
turtle
# import turtle
screen
=
turtle
.
Screen
()
# screen=turtle.Screen()
screen
.
bgcolor
(
"light blue"
)
# screen.bgcolor("light blue")
len
=
screen
.
textinput
(
"提示"
,
"你想要多大的爱心呀?"
)
# len=screen.textinput("提示","你想要多大的爱心呀?")
len
=
int
(
len
)
# len=int(len)
pen
=
turtle
.
Pen
()
# pen=turtle.Pen()
pen
.
write
(
"你好/nfuck."
,
font
=
(
"Times"
,
30
,
"normal"
))
# pen.write("你好/nfuck.",font=("Times",30,"normal"))
pen
.
hideturtle
()
# pen.hideturtle()
len
=
60
# len=60
pen
.
penup
()
# pen.penup()
pen
.
goto
(
100
,
100
)
# pen.goto(100,100)
pen
.
pendown
()
# pen.pendown()
pen
.
pensize
(
5
)
# pen.pensize(5)
pen
.
pencolor
(
"red"
)
# pen.pencolor("red")
pen
.
left
(
45
)
# pen.left(45)
pen
.
forward
(
2
*
len
)
# pen.forward(2*len)
pen
.
circle
(
len
,
180
)
# pen.circle(len,180)
pen
.
right
(
90
)
# pen.right(90)
pen
.
circle
(
len
,
180
)
# pen.circle(len,180)
pen
.
forward
(
2
*
len
)
# pen.forward(2*len)
turtle
.
done
()
\ No newline at end of file
import
turtlea
hlfl
=
turtle
.
Pen
()
hlfl
.
pencolor
(
"black"
)
hlfl
.
pensize
(
2
)
hlfl
.
write
(
"噫吁嚱,危乎高哉!
\n
蜀道之难,难于上青天!
\n
蚕丛及鱼凫,开国何茫然!
\n
"
,
font
=
(
"宋体"
,
18
,
"normal"
))
hlfl
.
pencolor
(
"red"
)
hlfl
.
penup
()
hlfl
.
goto
(
-
110
,
50
)
# hlfl.write("问君西游何时还?畏途巉岩不可攀。但见悲鸟号古木,雄飞雌从绕林间。又闻子规啼夜月,愁空山。蜀道之难,难于上青天,使人听此凋朱颜!连峰去天不盈尺,枯松倒挂倚绝壁。飞湍瀑流争喧豗,砯崖转石万壑雷。其险也如此,嗟尔远道之人胡为乎来哉!")
hlfl
.
left
(
45
)
hlfl
.
pendown
()
hlfl
.
forward
(
100
)
# 剑阁峥嵘而崔嵬,一夫当关,万夫莫开。所守或匪亲,化为狼与豺。朝避猛虎,夕避长蛇;磨牙吮血,杀人如麻。锦城虽云乐,不如早还家。蜀道之难,难于上青天,侧身西望长咨嗟!")
hlfl
.
circle
(
50
,
180
)
hlfl
.
right
(
90
)
hlfl
.
circle
(
50
,
180
)
hlfl
.
forward
(
100
)
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