Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = [
- [0] * 6,
- [0] * 6,
- [0, 0, 1, 0, 0, 0],
- [0] * 6,
- [0] * 6,
- [0] * 6,
- ]
- # 0 ->
- # 22
- # 20
- #
- # 1 ->
- # 22
- # 12
- #
- # 2 ->
- # 12
- # 22
- #
- # 3 ->
- # 21
- # 22
- cover (m, p1, p2, start, start_type):
- width = p2[0] - p1[0] + 1
- height = p2[1] = p1[1] + 1
- if width < 2 or height < 2:
- return None
- x,y = start;
- if start_type == 0:
- starts = [
- start, (x, y + 1),
- (x + 1, y), (x + 1, y + 1)
- ]
- elif start_type == 1:
- starts = [
- (x - 1, y), start,
- (x - 1, y - 1), (x - 1, y)
- ]
- elif start_type == 2:
- starts = [
- (x - 1, y), (x - 1, y + 1),
- start, (x, y + 1)
- ]
- else:
- starts = [
- (x - 1, y - 1), (x - 1, y),
- (x, y - 1), start
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement