genxword icon indicating copy to clipboard operation
genxword copied to clipboard

The wordlist is sorted in reverse

Open anianruoss opened this issue 4 months ago • 0 comments

Thanks for this great library!

I noticed that the cli version does not react to my request of generating smaller grid sizes. After some digging, I realized that the word list is sorted from longest to shortest, which means that the following line in check_grid_size is False even if it shouldn't:

if len(self.wordlist[0][0]) < min(nrow, ncol):

This can easily be fixed by changing

self.wordlist.sort(key=lambda i: len(i[0]), reverse=True)

to

self.wordlist.sort(key=lambda i: len(i[0]), reverse=False)

anianruoss avatar Oct 07 '24 19:10 anianruoss