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
a42cb467
authored
Feb 20, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
b1faef5e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
1 deletions
11.py
diy1.py
11.py
0 → 100644
View file @
a42cb467
import
turtle
import
random
pen
=
turtle
.
Pen
()
turtle
.
screensize
(
800
,
600
)
turtle
.
Screen
()
.
bgcolor
(
"#ffffff"
)
def
getColor
():
color
:
int
r
=
random
.
randint
(
16
,
255
)
g
=
random
.
randint
(
16
,
255
)
b
=
random
.
randint
(
16
,
255
)
r
=
hex
(
r
)
g
=
hex
(
g
)
b
=
hex
(
b
)
rgb
=
"#"
+
r
[
2
:]
+
g
[
2
:]
+
b
[
2
:]
return
rgb
def
heart
():
color
=
getColor
()
pen
.
fillcolor
(
color
)
pen
.
begin_fill
()
pen
.
left
(
45
)
pen
.
forward
(
20
)
pen
.
circle
(
10
,
180
)
pen
.
right
(
90
)
pen
.
circle
(
10
,
180
)
pen
.
forward
(
20
)
pen
.
end_fill
()
def
pengo
():
x
=
random
.
randint
(
-
400
,
400
)
y
=
random
.
randint
(
-
300
,
300
)
pen
.
penup
()
pen
.
goto
(
x
,
y
)
pen
.
pendown
()
def
start
():
pen
.
write
(
"不会上课陈十一"
,
font
=
(
"华文行楷"
,
42
,
"normal"
))
pen
.
speed
(
0
)
def
end
():
pen
.
hideturtle
()
turtle
.
done
()
def
heart300
():
for
i
in
range
(
300
):
heart
()
pengo
()
def
fengche
():
n
=
random
.
randint
(
300
,
500
)
pen
.
goto
(
0
,
0
)
pen
.
pendown
()
for
i
in
range
(
1
,
n
):
pen
.
forward
(
i
)
pen
.
pencolor
(
getColor
())
pen
.
right
(
91
)
start
()
fengche
()
heart300
()
end
()
\ No newline at end of file
diy1.py
View file @
a42cb467
...
...
@@ -3,7 +3,7 @@ import turtle
screen
=
turtle
.
Screen
()
screen
.
bgcolor
(
"light blue"
)
pen
=
turtle
.
Pen
()
pen
.
write
(
"你好
/nfuck."
,
font
=
(
"Times
"
,
30
,
"normal"
))
pen
.
write
(
"你好
\n
换
\t
行了."
,
font
=
(
"华文行楷
"
,
30
,
"normal"
))
pen
.
hideturtle
()
pen
.
penup
()
...
...
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