fine tune wordsearch
This commit is contained in:
parent
42c91d2ceb
commit
1571db0a35
@ -95,13 +95,13 @@ 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)
|
||||
r = RandomWord()
|
||||
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
|
||||
|
@ -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.wordPosition)
|
||||
# print(w.grid)
|
||||
# w.findWords(words.split(','))
|
||||
print(w.wordPosition)
|
||||
|
Loading…
Reference in New Issue
Block a user