Commit dd1223ce by BellCodeEditor

save project

parent 51d712cd
Showing with 28 additions and 27 deletions
center = [2,8]
shape = random.choice(shape_list)
inddex = random.rndint(0,len(shape)-1)
current_shape = shape[index]
color = rendom.choice(cube_color)
def check(center):
for cube in surrent_shape:
cube = (cube[0]+center[0],cube[1]+center[1])
if cube[0]<1 or cube[1]<1 or cube[0]>grid_nu
or cube[1]>grid_nu_width:
return False
elif event.key == locals.K_UP:
old_index = Index
index += 1
if index >= len(shape)
index = 0
current_shape = shape[index]
if check(center) == False:
index = old_index
current_shape = shape[index]
if staes == False:
states = True
center = [2,8]
shape = random.choice(shape_list)
count += 1
states = False
\ No newline at end of file
import time
start_time = time.time()
print("开始时间为:",start_time)
list1 = []
for a in range(0,100):
for b in range(0,100):
list1.insert(0,0)
eend_time = time.time()
print("结束时间为:",end_time)
result = end_time - start_time
print("总共耗时:",result)
num_list = []
for i in range(25):
num_list.append([0] * 15)
for i, row in zip(range(1,26),num_list):
for j, colors in zip(range(1,16),row)
if colors !=0:
pygame.draw.rect(screen,colors,
(j * 20-20, i * 20-20, 20, 20))
pygame.draw.rect(screen, (255, 255, 255),
(j * 20-20, i * 20-20, 20, 20), 1)
new_list []
for i in range(25):
new_list.append([0] * 15)
row_index = 24
for i in range(24, -1, -1):
is_full = True
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment