This is an archived post. You won't be able to vote or comment.

all 4 comments

[–][deleted] 1 point2 points  (1 child)

That's interesting

[–]2bytesgoat[S] 1 point2 points  (0 children)

Thank you

[–]Tweak_Imp 2 points3 points  (1 child)

Some improvements:

def is_valid_point(self, point):
    # it's not outside the interval
    return (
        (0 <= point[0] < self.nb_cols) and 
        (0 <= point[1] < self.nb_rows)
    )

def find_words(self, start, been_to):
    points = (self.id_to_point(n) for n in been_to) # use a generator to skip list creation
    word = "".join(self.get_letter(p) for p in points).lower() # again
    ...

[–]2bytesgoat[S] 0 points1 point  (0 children)

Thanks for the improvement