def filter_givens(all_ships):
"remove ships that conflict with board givens"
knowns = set(xy for xy in table if table[xy] != '.')
for ship1 in all_ships:
points = exact_ship(*ship1)
okay = not any(points[xy] != table[xy] for xy in knowns & set(points))
if okay:
yield ship1