add all stages back in, modify word search

This commit is contained in:
samerbam 2023-08-23 13:14:27 -04:00
parent eda408308e
commit bcacc3f4e4
2 changed files with 21 additions and 21 deletions

View File

@ -87,8 +87,8 @@ class ThermalPrinter():
todo_text = textwrap.wrap(x[1], todo_text_max_len)
# t_text = textwrap.wrap()
fele = todo_text.pop(0)
print(todo_text_max_len-len(fele))
print(fele)
# print(todo_text_max_len-len(fele))
# print(fele)
self.p.text(" " + " "*(todo_text_max_len-len(fele)) + fele + "\n")
todo_text = textwrap.wrap(' '.join(todo_text), 32)
@ -154,8 +154,8 @@ class ThermalPrinter():
def print_wordsearch(self):
# words = ("gugu,gaga")
r = RandomWord()
words = r.random_words(15, include_parts_of_speech=["nouns", "verbs", "adjectives"])
w = WordSearch(','.join(words), 32, 16)
words = r.random_words(15, include_parts_of_speech=["nouns", "verbs", "adjectives"], word_max_length=16)
w = WordSearch(','.join(words), 16, 16)
self.p.set(align="left")
self.p.text("Word Search:")
@ -163,7 +163,7 @@ class ThermalPrinter():
self.p.set(align="center")
for x in w.grid:
self.p.text(''.join(x) + "\n")
self.p.text(' '.join(x) + "\n")
self.p.set(align="left")
self.p.text("\nWords: \n")
@ -187,25 +187,25 @@ class ThermalPrinter():
# print(w.wordPosition)
def print_default(self):
print('start 1')
# print('start 1')
self.print_greeting()
print('end 1')
# print('end 1')
print('start 2')
# print('start 2')
self.print_todos()
print('end 2')
# print('end 2')
print('start 3')
# self.print_sudoku()
print('end 3')
# print('start 3')
self.print_sudoku()
# print('end 3')
print('start 4')
# self.print_wordsearch()
print('end 4')
# print('start 4')
self.print_wordsearch()
# print('end 4')
print('start 5')
# self.print_random_quote()
print('end 5')
# print('start 5')
self.print_random_quote()
# print('end 5')
self.finished_printing()
def _parse_todos(self, data):

View File

@ -216,14 +216,14 @@ if __name__ == '__main__':
from wonderwords import RandomWord
r = RandomWord()
words = r.random_words(15, include_parts_of_speech=["nouns", "verbs", "adjectives"])
w = WordSearch(','.join(words), 32, 16)
words = r.random_words(5, include_parts_of_speech=["nouns", "verbs", "adjectives"], word_max_length=16)
print(words)
w = WordSearch(','.join(words), 16, 16)
def printGrid(grid):
for row in grid:
for column in row:
print("%s" % column, end='')
print("%s " % column, end='')
print()
printGrid(w.grid)
# print(w.grid)