Пример #1
0
def main(command, *args):
    """Main function"""
    if len(args) != 1:
        print_err('''Invalid arguments!
See \''''+command+''' -h' for more information.''')
        return 1
    if args[0] == "-V":
        print_version(command)
        return 0
    if args[0] == "-h":
        print_usage(command)
        return 0
    puzzle = parse_from_file(args[0])
    puzzle.solve()
    print("\033[1mWords found:\033[0m")
    for word in puzzle.getSolved():
        print_msg(*word)
    print("\033[1mWords not found:\033[0m")
    for word in puzzle.getUnsolved():
        print_msg(*word)
    return 0
Пример #2
0
def print_usage(command):
    """Prints usage"""
    print_msg(__doc__.replace("<the name of this file>",command))
Пример #3
0
def print_version(command):
    """Prints version infromation"""
    print_msg('''Words Search Puzzle solving program, version '''+version)