MCPcopy Create free account
hub / github.com/ActiveState/code / remove_full_lines

Function remove_full_lines

recipes/Python/580680_Tetris/recipe-580680.py:97–113  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95class Fall(Exception): pass
96
97def remove_full_lines():
98 global shaft, width, height
99 def line_full(line):
100 global width
101 for x in range(width):
102 if line[x] == empty:
103 return False
104 return True
105
106 def remove_line(y):
107 global shaft, width
108 del shaft[y] # cut out line
109 shaft.insert(0, [ empty ] * width) # fill up with an empty line
110
111 for y in range(height):
112 if line_full(shaft[y]):
113 remove_line(y)
114
115def fall_delay():
116 return 1.3 # cheap version; implement raising difficulty here

Callers 1

play_tetrisFunction · 0.85

Calls 3

rangeFunction · 0.85
line_fullFunction · 0.85
remove_lineFunction · 0.85

Tested by

no test coverage detected