Wordsearch puzzle generator implementation in Python