def print_patterns(Field, Formations): print("Patterns") byPatternLen = OrderedDict(((5, set()), (4, set()), (3, set()), (2, set()))) for Pattern, _ in chain(*Formations): byPatternLen[len(Pattern)].update(Pattern) colorArgs = byPatternLen.values() win_terface.print_colorized_board(Field.rows, *colorArgs) print()
def print_moves(Field, Moves): print("Moves") Pattern, From, To = zip(*Moves) win_terface.print_colorized_board(Field.rows, From, To, [], set(chain(*Pattern))) print()