Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson11_diy3
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
db44c835
authored
Jun 05, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
0803ba66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
1.py
1.py
View file @
db44c835
...
@@ -30,7 +30,8 @@ S = [[(-1, 0), (0, 0), (0, 1), (1, 1)],
...
@@ -30,7 +30,8 @@ S = [[(-1, 0), (0, 0), (0, 1), (1, 1)],
T
=
[[(
0
,
-
1
),
(
0
,
0
),
(
0
,
1
),
(
-
1
,
0
)],
T
=
[[(
0
,
-
1
),
(
0
,
0
),
(
0
,
1
),
(
-
1
,
0
)],
[(
-
1
,
0
),
(
0
,
0
),
(
1
,
0
),
(
0
,
1
)],
[(
-
1
,
0
),
(
0
,
0
),
(
1
,
0
),
(
0
,
1
)],
[(
0
,
-
1
),
(
0
,
0
),
(
0
,
1
),
(
1
,
0
)],
[(
0
,
-
1
),
(
0
,
0
),
(
0
,
1
),
(
1
,
0
)],
[(
-
1
,
0
),
(
0
,
0
),
(
1
,
0
),
(
0
,
-
1
)]]
J
=
[[(
-
1
,
0
),
(
0
,
0
),
(
1
,
0
),
(
1
,
-
1
)],
[(
-
1
,
0
),
(
0
,
0
),
(
1
,
0
),
(
0
,
-
1
)]]
J
=
[[(
-
1
,
0
),
(
0
,
0
),
(
1
,
0
),
(
1
,
-
1
)],
[(
0
,
-
1
),
(
0
,
0
),
(
0
,
1
),
(
-
1
,
-
1
)],
[(
0
,
-
1
),
(
0
,
0
),
(
0
,
1
),
(
-
1
,
-
1
)],
[(
-
1
,
0
),
(
0
,
0
),
(
1
,
0
),
(
-
1
,
1
)],
[(
-
1
,
0
),
(
0
,
0
),
(
1
,
0
),
(
-
1
,
1
)],
[(
0
,
-
1
),
(
0
,
0
),
(
0
,
1
),
(
1
,
1
)]]
[(
0
,
-
1
),
(
0
,
0
),
(
0
,
1
),
(
1
,
1
)]]
...
@@ -41,8 +42,7 @@ L = [[(-1, 0), (0, 0), (1, 0), (1, 1)],
...
@@ -41,8 +42,7 @@ L = [[(-1, 0), (0, 0), (1, 0), (1, 1)],
shape_list
=
[
I
,
J
,
L
,
O
,
S
,
T
,
Z
]
# 7种类型俄罗斯方块
shape_list
=
[
I
,
J
,
L
,
O
,
S
,
T
,
Z
]
# 7种类型俄罗斯方块
# 一些RGB颜色
# 一些RGB颜色
cube_colors
=
cube_colors
=
[(
204
,
153
,
153
),
(
102
,
102
,
153
),(
153
,
0
,
102
),
[(
204
,
153
,
153
),
(
102
,
102
,
153
),(
153
,
0
,
102
),
(
255
,
204
,
0
),
(
204
,
0
,
51
),(
255
,
0
,
51
),
(
0
,
102
,
153
),
(
255
,
204
,
0
),
(
204
,
0
,
51
),(
255
,
0
,
51
),
(
0
,
102
,
153
),
(
153
,
0
,
51
),
(
204
,
255
,
102
),
(
255
,
153
,
0
)]
(
153
,
0
,
51
),
(
204
,
255
,
102
),
(
255
,
153
,
0
)]
...
@@ -56,7 +56,8 @@ def check(center):
...
@@ -56,7 +56,8 @@ def check(center):
if
num_list
[
cube
[
0
]
-
1
][
cube
[
1
]
-
1
]
!=
0
:
if
num_list
[
cube
[
0
]
-
1
][
cube
[
1
]
-
1
]
!=
0
:
return
False
return
False
# 格子基础数字设为0
# 格子基础数字设为0
num_list
=
[]
for
i
in
range
(
25
):
num_list
=
[]
for
i
in
range
(
25
):
num_list
.
append
([
0
]
*
15
)
num_list
.
append
([
0
]
*
15
)
while
True
:
while
True
:
...
@@ -131,7 +132,7 @@ while True:
...
@@ -131,7 +132,7 @@ while True:
is_full
=
True
is_full
=
True
for
j
in
range
(
grid_num_width
):
for
j
in
range
(
grid_num_width
):
if
num_list
[
i
][
j
]
==
0
:
if
num_list
[
i
][
j
]
==
0
:
is_full
=
False
is_full
=
False
if
is_full
==
False
:
if
is_full
==
False
:
new_list
[
row_index
]
=
num_list
[
i
]
new_list
[
row_index
]
=
num_list
[
i
]
row_index
-=
1
row_index
-=
1
...
...
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