Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-3-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
a5210ee7
authored
Mar 13, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
bac5d92a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
rps.py
rps.py
0 → 100644
View file @
a5210ee7
#1、画什么
import
turtle
#2、画在哪里 准备纸(大小 材质)
SCREEN_WIDTH
=
400
SCREEN_HEIGHT
=
300
SCREEN_BGCOLOR
=
"black"
PEN_COLOR
=
"white"
PEN_SIZE
=
2
PEN_SPEED
=
5
#[0,10]
STARTX
=
-
100
STARTY
=
100
ANGLE
=
170
LENGTH
=
100
FILLCOLOR
=
"yellow"
turtle
.
screensize
(
SCREEN_WIDTH
,
SCREEN_HEIGHT
,
SCREEN_BGCOLOR
)
#3、用什么画 准备笔(颜色 粗细 笔速)
pen
=
turtle
.
Pen
()
pen
.
pencolor
(
PEN_COLOR
)
pen
.
pensize
(
PEN_SIZE
)
pen
.
speed
(
PEN_SPEED
)
#[0,10] 0最快 1-10慢慢变快
pen
.
shape
(
"turtle"
)
#4、从哪里开始作画 起始点
pen
.
penup
()
pen
.
goto
(
STARTX
,
STARTY
)
#pen.setpos()
pen
.
pendown
()
#5、作画
pen
.
fillcolor
(
FILLCOLOR
)
pen
.
begin_fill
()
for
times
in
range
(
0
,
100
,
1
):
pen
.
forward
(
LENGTH
)
pen
.
right
(
ANGLE
)
pen
.
end_fill
()
#6、完成收尾
pen
.
hideturtle
()
turtle
.
done
()
#turle.mainloop()
\ 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