def _compute_walls(self, width, height):
'''
Args:
width (int)
height (int)
Returns:
(list): Contains (x,y) pairs that define wall locations.
'''
walls = []
half_width = math.ceil(width / 2.0)
half_height = math.ceil(height / 2.0)
for i in range(1, width + 1):
if i == (width + 1) / 3 or i == math.ceil(2 * (width + 1) / 3.0):
continue
walls.append((i, half_height))
for j in range(1, height + 1):
if j == (height + 1) / 3 or j == math.ceil(2 * (height + 1) / 3.0):
continue
walls.append((half_width, j))
return walls
评论列表
文章目录