Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson1_5
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
affc4e5e
authored
Mar 05, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
bdb13d18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
shape.py
shape.py
0 → 100644
View file @
affc4e5e
import
turtle
SCREEN_WIDTH
=
400
SCREEN_HEIGHT
=
300
SCREEN_BGCOLOR
=
"black"
PEN_COLOR
=
"white"
PEN_SIZE
=
2
PEN_SPEED
=
5
STARTX
=
0
STARTY
=
0
LENGTH
=
200
ANGLE
=
144
#准备纸 画在哪里
turtle
.
screensize
(
SCREEN_WIDTH
,
SCREEN_HEIGHT
,
SCREEN_BGCOLOR
)
#准备笔 用什么画
pen
=
turtle
.
Pen
()
pen
.
pencolor
(
PEN_COLOR
)
pen
.
pensize
(
PEN_SIZE
)
pen
.
speed
(
PEN_SPEED
)
pen
.
shape
(
"turtle"
)
#从哪里开始画 起始点
pen
.
penup
()
pen
.
goto
(
STARTX
,
STARTY
)
#pen.setposition(x,y)
pen
.
pendown
()
#开始作画
pen
.
fillcolor
(
"yellow"
)
pen
.
begin_fill
()
for
times
in
range
(
0
,
5
,
1
):
pen
.
forward
(
LENGTH
)
pen
.
right
(
ANGLE
)
pen
.
end_fill
()
pen
.
hideturtle
()
turtle
.
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