Comments are moderated. It may take a few minutes before your comment appears.
Markdown is supported in your comments.
def every_ship(prefix, size):
for x1,y1,d in product(xs, ys, 'SE'):
if size == 1 and d == 'S':
continue
if d == 'E' and x1 + (size-1) not in xs:
continue
if d == 'S' and y1 + (size-1) not in ys:
continue
yield prefix, x1, y1, size, d