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