Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson3-3_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
eee7861c
authored
Aug 23, 2020
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
654bc3ba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
..py
diy1.py
..py
0 → 100644
View file @
eee7861c
from
turtle
import
*
from
random
import
random
,
randint
s
=
Screen
()
width
,
height
=
800
,
600
s
.
setup
(
width
,
height
)
#输入宽和高为整数时, 表示像素; 为小数时, 表示占据电脑屏幕的比例
s
.
title
(
"模拟3D星空-阿黎逸阳"
)
#设置标题
s
.
bgcolor
(
"black"
)
#设置背景颜色为黑色
s
.
mode
(
"logo"
)
#设置乌龟模式(“standard”,“logo”或“world”)并执行重置,logo表示向上
s
.
delay
(
0
)
#设置或返回以毫秒为单位的绘图延迟,这里要设为0,否则很卡
printer
=
Turtle
()
printer
.
hideturtle
()
printer
.
penup
()
printer
.
color
(
'white'
)
printer
.
goto
(
-
100
,
-
150
)
printer
.
write
(
"In the whole universe
\n\n
"
,
move
=
True
,
align
=
"left"
,
font
=
(
"Italic"
,
30
,
"bold"
))
printer
.
goto
(
-
300
,
-
200
)
printer
.
write
(
"you're the only star belongs me!
\n\n
"
,
move
=
True
,
align
=
"left"
,
font
=
(
"Italic"
,
30
,
"bold"
))
diy1.py
0 → 100644
View file @
eee7861c
# 利用write()帮助悟空给诺依回信吧~
import
turtle
screen
=
turtle
.
Screen
()
screen
.
bgcolor
(
"#0000FF"
)
pen
=
turtle
.
Pen
()
pen
.
penup
()
pen
.
goto
(
100
,
0
)
pen
.
write
(
"贺新郎 弹铗西来路
\n\n
记匆匆
\n
经行十日
\n
几番风雨
\n
"
,
font
=
(
"Times"
,
30
,
"normal"
))
pen2
=
turtle
.
Pen
()
pen2
.
pencolor
(
"#FFFAFA"
)
pen2
.
pensize
(
5
)
pen2
.
left
(
45
)
pen2
.
forward
(
100
)
pen2
.
circle
(
50
,
180
)
pen2
.
right
(
90
)
pen2
.
circle
(
50
,
180
)
pen2
.
forward
(
100
)
pen2
.
hideturtle
()
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