add all stages back in, modify word search
This commit is contained in:
parent
eda408308e
commit
bcacc3f4e4
@ -87,8 +87,8 @@ class ThermalPrinter():
|
|||||||
todo_text = textwrap.wrap(x[1], todo_text_max_len)
|
todo_text = textwrap.wrap(x[1], todo_text_max_len)
|
||||||
# t_text = textwrap.wrap()
|
# t_text = textwrap.wrap()
|
||||||
fele = todo_text.pop(0)
|
fele = todo_text.pop(0)
|
||||||
print(todo_text_max_len-len(fele))
|
# print(todo_text_max_len-len(fele))
|
||||||
print(fele)
|
# print(fele)
|
||||||
self.p.text(" " + " "*(todo_text_max_len-len(fele)) + fele + "\n")
|
self.p.text(" " + " "*(todo_text_max_len-len(fele)) + fele + "\n")
|
||||||
|
|
||||||
todo_text = textwrap.wrap(' '.join(todo_text), 32)
|
todo_text = textwrap.wrap(' '.join(todo_text), 32)
|
||||||
@ -154,8 +154,8 @@ class ThermalPrinter():
|
|||||||
def print_wordsearch(self):
|
def print_wordsearch(self):
|
||||||
# words = ("gugu,gaga")
|
# words = ("gugu,gaga")
|
||||||
r = RandomWord()
|
r = RandomWord()
|
||||||
words = r.random_words(15, include_parts_of_speech=["nouns", "verbs", "adjectives"])
|
words = r.random_words(15, include_parts_of_speech=["nouns", "verbs", "adjectives"], word_max_length=16)
|
||||||
w = WordSearch(','.join(words), 32, 16)
|
w = WordSearch(','.join(words), 16, 16)
|
||||||
|
|
||||||
self.p.set(align="left")
|
self.p.set(align="left")
|
||||||
self.p.text("Word Search:")
|
self.p.text("Word Search:")
|
||||||
@ -163,7 +163,7 @@ class ThermalPrinter():
|
|||||||
self.p.set(align="center")
|
self.p.set(align="center")
|
||||||
|
|
||||||
for x in w.grid:
|
for x in w.grid:
|
||||||
self.p.text(''.join(x) + "\n")
|
self.p.text(' '.join(x) + "\n")
|
||||||
|
|
||||||
self.p.set(align="left")
|
self.p.set(align="left")
|
||||||
self.p.text("\nWords: \n")
|
self.p.text("\nWords: \n")
|
||||||
@ -187,25 +187,25 @@ class ThermalPrinter():
|
|||||||
# print(w.wordPosition)
|
# print(w.wordPosition)
|
||||||
|
|
||||||
def print_default(self):
|
def print_default(self):
|
||||||
print('start 1')
|
# print('start 1')
|
||||||
self.print_greeting()
|
self.print_greeting()
|
||||||
print('end 1')
|
# print('end 1')
|
||||||
|
|
||||||
print('start 2')
|
# print('start 2')
|
||||||
self.print_todos()
|
self.print_todos()
|
||||||
print('end 2')
|
# print('end 2')
|
||||||
|
|
||||||
print('start 3')
|
# print('start 3')
|
||||||
# self.print_sudoku()
|
self.print_sudoku()
|
||||||
print('end 3')
|
# print('end 3')
|
||||||
|
|
||||||
print('start 4')
|
# print('start 4')
|
||||||
# self.print_wordsearch()
|
self.print_wordsearch()
|
||||||
print('end 4')
|
# print('end 4')
|
||||||
|
|
||||||
print('start 5')
|
# print('start 5')
|
||||||
# self.print_random_quote()
|
self.print_random_quote()
|
||||||
print('end 5')
|
# print('end 5')
|
||||||
self.finished_printing()
|
self.finished_printing()
|
||||||
|
|
||||||
def _parse_todos(self, data):
|
def _parse_todos(self, data):
|
||||||
|
@ -216,14 +216,14 @@ if __name__ == '__main__':
|
|||||||
from wonderwords import RandomWord
|
from wonderwords import RandomWord
|
||||||
|
|
||||||
r = RandomWord()
|
r = RandomWord()
|
||||||
words = r.random_words(15, include_parts_of_speech=["nouns", "verbs", "adjectives"])
|
words = r.random_words(5, include_parts_of_speech=["nouns", "verbs", "adjectives"], word_max_length=16)
|
||||||
w = WordSearch(','.join(words), 32, 16)
|
|
||||||
print(words)
|
print(words)
|
||||||
|
w = WordSearch(','.join(words), 16, 16)
|
||||||
|
|
||||||
def printGrid(grid):
|
def printGrid(grid):
|
||||||
for row in grid:
|
for row in grid:
|
||||||
for column in row:
|
for column in row:
|
||||||
print("%s" % column, end='')
|
print("%s " % column, end='')
|
||||||
print()
|
print()
|
||||||
printGrid(w.grid)
|
printGrid(w.grid)
|
||||||
# print(w.grid)
|
# print(w.grid)
|
||||||
|
Loading…
Reference in New Issue
Block a user