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
2060991c
authored
May 14, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
2a58c9de
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
187 additions
and
1 deletions
diy1.py
fj.py
s.py
diy1.py
View file @
2060991c
...
@@ -5,7 +5,7 @@ screen.bgcolor("light blue")
...
@@ -5,7 +5,7 @@ screen.bgcolor("light blue")
len
=
screen
.
textinput
(
"100"
,
"100"
)
len
=
screen
.
textinput
(
"100"
,
"100"
)
len
=
int
(
len
)
len
=
int
(
len
)
pen
=
turtle
.
Pen
()
pen
=
turtle
.
Pen
()
pen
.
write
(
"你好
\
n
SB
."
,
font
=
(
"Times"
,
30
,
"normal"
))
pen
.
write
(
"你好
\
诺伊
."
,
font
=
(
"Times"
,
30
,
"normal"
))
pen
.
hideturtle
()
pen
.
hideturtle
()
len
=
60
len
=
60
pen
.
penup
()
pen
.
penup
()
...
...
fj.py
0 → 100644
View file @
2060991c
import
turtle
turtle
.
screensize
(
width
,
height
,
color
)
turtle
.
setup
(
width
,
height
,
startx
,
starty
)
import
turtleturtle.Screen
()
.
title
(
'绘图工具'
)
turtle
.
pencolor
(
'green'
)
#设置画笔的颜色为绿色,默认黑色
color
()
turtle
.
pensize
(
1
)
#设置画笔大小
turtle
.
width
()
turtle
.
speed
(
20
)
#设置画笔速度 范围是[0,10]#也可以使用turtle.Pen()
\ No newline at end of file
s.py
0 → 100644
View file @
2060991c
import
turtle
as
t
t
.
speed
(
1000
)
def
triangle
(
a
,
b
,
c
):
t
.
penup
()
t
.
goto
(
a
,
b
)
t
.
pendown
()
t
.
fillcolor
(
'purple'
)
t
.
begin_fill
()
t
.
forward
(
c
)
t
.
left
(
120
)
t
.
forward
(
c
)
t
.
left
(
120
)
t
.
forward
(
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
.
left
(
90
)
f
t
.
forward
(
10
)
f
t
.
left
(
90
)
f
t
.
forward
(
d
)
f
t
.
left
(
90
)
f
t
.
end_fill
()
f
def
floor
(
a
,
b
):
f
t
.
penup
()
f
t
.
goto
(
a
,
b
)
f
t
.
pendown
()
f
t
.
fillcolor
(
"purple"
)
f
t
.
begin_fill
()
f
t
.
forward
(
50
)
f
t
.
left
(
90
)
f
t
.
forward
(
20
)
f
for
i
in
range
(
0
,
2
,
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
(
20
)
f
t
.
left
(
90
)
f
t
.
end_fill
()
f
def
decoration
(
a
,
b
):
f
t
.
penup
()
f
t
.
goto
(
a
,
b
)
f
t
.
pendown
()
f
t
.
fillcolor
(
"black"
)
f
t
.
begin_fill
()
f
t
.
forward
(
10
)
f
t
.
left
(
90
)
f
t
.
forward
(
10
)
f
t
.
circle
(
5
,
180
)
f
t
.
forward
(
10
)
f
t
.
end_fill
()
f
t
.
left
(
90
)
f
def
decoration1
(
a
,
b
):
f
t
.
penup
()
f
t
.
goto
(
a
,
b
)
f
t
.
pendown
()
f
t
.
fillcolor
(
"black"
)
f
t
.
begin_fill
()
f
t
.
forward
(
8
)
f
t
.
left
(
90
)
f
t
.
forward
(
8
)
f
t
.
circle
(
4
,
180
)
f
t
.
forward
(
8
)
f
t
.
end_fill
()
f
t
.
left
(
90
)
f
def
door
(
a
,
b
):
f
t
.
penup
()
f
t
.
goto
(
a
,
b
)
f
t
.
pendown
()
f
t
.
fillcolor
(
"black"
)
f
t
.
begin_fill
()
f
t
.
forward
(
20
)
f
t
.
left
(
90
)
f
t
.
forward
(
20
)
f
t
.
circle
(
10
,
180
)
f
t
.
forward
(
20
)
f
t
.
end_fill
()
f
t
.
left
(
90
)
f
t
.
pensize
(
3
)
f
t
.
pencolor
(
"black"
)
f
square
(
-
30
,
90
,
20
,
40
)
f
square
(
10
,
90
,
20
,
30
)
f
wall
(
-
45
,
0
,
90
,
100
)
f
square
(
-
85
,
-
60
,
30
,
30
)
f
square
(
55
,
-
60
,
30
,
30
)
f
square
(
-
75
,
-
20
,
30
,
50
)
f
square
(
45
,
-
20
,
30
,
50
)
f
door
(
0
,
0
)
f
downwall
(
-
55
,
-
60
,
110
,
70
)
f
floor
(
-
105
,
-
30
)
f
floor
(
55
,
-
30
)
f
triangle
(
-
75
,
30
,
30
)
f
triangle
(
45
,
30
,
30
)
f
triangle
(
-
30
,
130
,
20
)
f
triangle
(
10
,
120
,
20
)
f
decoration
(
10
,
70
)
f
decoration
(
10
,
40
)
f
decoration
(
-
20
,
60
)
f
decoration1
(
-
64
,
10
)
f
decoration1
(
60
,
10
)
f
decoration1
(
-
22.5
,
110
)
f
decoration1
(
14.5
,
100
)
f
door
(
-
10
,
-
60
)
f
t
.
penup
()
f
pen1
=
t
.
Pen
()
f
pen1
.
goto
(
0
,
-
100
)
f
pen1
.
pendown
()
f
pen1
.
write
(
"妈妈
\n
母亲节快乐"
,
font
=
(
"Times"
,
30
,
"文化字体"
))
f
pen1
.
hideturtle
()
f
pen1
.
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