Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson13-diy2
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
772ee7e3
authored
Jan 11, 2025
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
7f9f3c44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
8 deletions
diy2.py
diy2.py
View file @
772ee7e3
alist
=
[
88
,
75
,
72
,
82
,
90
,
85
,
78
,
91
]
import
turtle
as
t
k
=
len
(
alist
)
import
random
as
r
for
i
in
range
(
0
,
k
-
1
):
t
.
setup
(
100
,
100
)
for
j
in
range
(
0
,
k
-
1
):
t
.
screensize
(
100
,
100
,
"blue"
)
if
alist
[
j
]
>
alist
[
i
]:
def
draw_circle
(
radius
,
color
,
y_position
):
alist
[
j
],
alist
[
j
+
1
]
=
alist
[
j
+
1
],
alist
[
j
]
t
.
penup
()
print
(
alist
)
t
.
pensize
(
5
)
\ No newline at end of file
t
.
fillcolor
(
color
)
t
.
goto
(
0
,
y_position
)
t
.
pendown
()
t
.
begin_fill
()
t
.
circle
(
radius
)
t
.
end_fill
()
def
draw_bullet
():
t
.
penup
()
t
.
goto
(
r
.
randint
(
-
200
,
200
),
r
.
randint
(
-
200
,
200
))
t
.
pendown
()
t
.
dot
(
50
)
draw_circle
(
200
,
'yellow'
,
-
200
)
draw_circle
(
150
,
'red'
,
-
150
)
draw_circle
(
100
,
'black'
,
-
100
)
draw_circle
(
50
,
'white'
,
-
50
)
for
_
in
range
(
5
):
draw_bullet
()
t
.
hideturtle
()
t
.
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