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
fc080e7f
authored
May 21, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
2060991c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
76 deletions
diy1.py
s.py
diy1.py
View file @
fc080e7f
# 利用write()帮助悟空给诺依回信吧~
import
turtle
(
"大小"
)
int
(
love
)
#创建背景 设置颜色
screen
=
turtle
.
Screen
()
screen
.
bgcolor
(
"light blue"
)
len
=
screen
.
textinput
(
"100"
,
"100"
)
len
=
int
(
len
)
pen
=
turtle
.
Pen
()
pen
.
write
(
"你好
\
诺伊."
,
font
=
(
"Times"
,
30
,
"normal"
))
#写字
pen
=
turtle
.
Pen
()
pen
.
write
(
"你好
\n
诺伊"
,
font
=
(
"宋体"
,
30
))
pen
.
hideturtle
()
len
=
60
pen
.
penup
()
pen
.
goto
(
100
,
100
)
pen
.
pendown
()
pen
.
pensize
(
5
)
pen
.
pencolor
(
"red"
)
pen
.
left
(
45
)
pen
.
forward
(
2
*
len
)
pen
.
circle
(
len
,
180
)
pen
.
right
(
90
)
pen
.
circle
(
len
,
180
)
pen
.
forward
(
2
*
len
)
turtle
.
done
()
#画
pen1
=
turtle
.
Pen
()
pen1
.
pencolor
(
"red"
)
pen1
.
pensize
(
5
)
pen1
.
left
(
45
)
pen1
.
forward
(
love
*
2
)
pen1
.
circle
(
love
,
180
)
pen1
.
right
(
90
)
pen1
.
circle
(
love
,
180
)
pen1
.
forward
(
love
*
2
)
pen1
.
hideturtle
()
turtle
.
done
()
\ No newline at end of file
s.py
View file @
fc080e7f
...
...
@@ -15,64 +15,61 @@ def triangle(a,b,c):
t
.
left
(
120
)
t
.
end_fill
()
def
square
(
a
,
b
,
c
,
d
):
t
.
penup
()
f
t
.
goto
(
a
,
b
)
f
t
.
pendown
()
f
t
.
fillcolor
(
"#cec2d6"
)
f
t
.
begin_fill
()
f
t
.
forward
(
c
)
f
t
.
left
(
90
)
f
t
.
forward
(
d
)
f
t
.
left
(
90
)
f
t
.
forward
(
c
)
f
t
.
left
(
90
)
f
t
.
forward
(
d
)
f
t
.
left
(
90
)
f
t
.
end_fill
()
f
def
wall
(
a
,
b
,
c
,
d
):
f
#a,b为坐标;c为底部宽,d为长f
t
.
penup
()
f
t
.
goto
(
a
,
b
)
f
t
.
pendown
()
f
t
.
fillcolor
(
"#cec2d6"
)
f
t
.
begin_fill
()
f
t
.
forward
(
c
)
f
t
.
left
(
90
)
f
t
.
forward
(
d
)
f
for
i
in
range
(
0
,
4
,
1
):
f
t
.
left
(
90
)
f
t
.
forward
(
10
)
f
t
.
left
(
90
)
f
t
.
forward
(
10
)
f
t
.
right
(
90
)
f
t
.
forward
(
10
)
f
t
.
right
(
90
)
f
t
.
forward
(
10
)
f
t
.
left
(
90
)
f
t
.
forward
(
10
)
f
t
.
left
(
90
)
f
t
.
forward
(
d
)
f
t
.
left
(
90
)
f
t
.
end_fill
()
f
def
downwall
(
a
,
b
,
c
,
d
):
f
#a,b为坐标;c为底部宽,d为长f
t
.
penup
()
f
t
.
goto
(
a
,
b
)
f
t
.
pendown
()
f
t
.
fillcolor
(
"#cec2d6"
)
f
t
.
begin_fill
()
f
t
.
forward
(
c
)
f
t
.
left
(
90
)
f
t
.
forward
(
d
)
f
for
i
in
range
(
0
,
5
,
1
):
f
t
.
left
(
90
)
f
t
.
forward
(
10
)
f
t
.
left
(
90
)
f
t
.
forward
(
10
)
f
t
.
right
(
90
)
f
t
.
forward
(
10
)
f
t
.
right
(
90
)
f
t
.
forward
(
10
)
f
t
.
penup
()
t
.
goto
(
a
,
b
)
t
.
pendown
()
t
.
fillcolor
(
"#cec2d6"
)
t
.
begin_fill
()
t
.
forward
(
c
)
t
.
left
(
90
)
t
.
forward
(
d
)
t
.
forward
(
c
)
t
.
left
(
90
)
t
.
forward
(
d
)
t
.
left
(
90
)
t
.
end_fill
()
def
wall
(
a
,
b
,
c
,
d
):
#a,b为坐标;c为底部宽,d为长
t
.
penup
()
t
.
goto
(
a
,
b
)
t
.
pendown
()
t
.
fillcolor
(
"#cec2d6"
)
t
.
begin_fill
()
t
.
forward
(
c
)
t
.
left
(
90
)
t
.
forward
(
d
)
for
i
in
range
(
0
,
4
,
1
):
t
.
left
(
90
)
t
.
forward
(
10
)
t
.
left
(
90
)
t
.
forward
(
10
)
t
.
right
(
90
)
t
.
forward
(
10
t
.
right
(
90
)
t
.
forward
(
10
)
t
.
left
(
90
)
t
.
forward
(
10
)
t
.
left
(
90
)
t
.
forward
(
d
)
t
.
left
(
90
)
t
.
end_fill
()
def
downwall
(
a
,
b
,
c
,
d
):
#a,b为坐标;c为底部宽,d为长
t
.
penup
()
t
.
goto
(
a
,
b
)
t
.
pendown
()
t
.
fillcolor
(
"#cec2d6"
)
t
.
begin_fill
()
t
.
forward
(
c
)
t
.
left
(
90
)
t
.
forward
(
d
)
t
.
forward
(
10
)
t
.
left
(
90
)
t
.
forward
(
10
)
t
.
right
(
90
)
t
.
forward
(
10
)
t
.
right
(
90
)
t
.
forward
(
10
)
t
.
left
(
90
)
f
t
.
forward
(
10
)
f
t
.
left
(
90
)
f
...
...
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