fine tune wordsearch

This commit is contained in:
samerbam 2023-08-22 23:08:19 -04:00
parent 42c91d2ceb
commit 1571db0a35
2 changed files with 26 additions and 8 deletions

View File

@ -96,12 +96,12 @@ class ThermalPrinter():
def print_wordsearch(self):
# words = ("gugu,gaga")
r = RandomWord()
words = r.random_words(10, include_parts_of_speech=["nouns", "verbs", "adjectives"])
w = WordSearch(','.join(words), 32, 32)
words = r.random_words(15, include_parts_of_speech=["nouns", "verbs", "adjectives"])
w = WordSearch(','.join(words), 32, 16)
for x in w.grid:
self.p.set(align="center")
self.p.text(x + "\n")
self.p.text(''.join(x) + "\n")
# Defaults.NOUNS: Represents a list of nouns
# Defaults.VERBS: Represents a list of verbs

View File

@ -201,13 +201,31 @@ class WordSearch():
# Test Progamm for WordSearch Genertator
if __name__ == '__main__':
words = ("gugu,gaga")
w = WordSearch(words, 10, 5)
# words = ("gugu,gaga")
# w = WordSearch(words, 10, 5)
# def printGrid(grid):
# for row in grid:
# for column in row:
# print("%s" % column, end='')
# print()
# printGrid(w.grid)
# w.findWords(words.split(','))
# print(w.wordPosition)
from wonderwords import RandomWord
r = RandomWord()
words = r.random_words(15, include_parts_of_speech=["nouns", "verbs", "adjectives"])
w = WordSearch(','.join(words), 32, 16)
print(words)
def printGrid(grid):
for row in grid:
for column in row:
print("%s" % column, end='')
print()
printGrid(w.grid)
w.findWords(words.split(','))
# print(w.grid)
# w.findWords(words.split(','))
print(w.wordPosition)