コード例 #1
0
def play_game(trie):
    letters = Cubes().shuffle()
    board = Board(letters)

    print board
    print 'You have 3 minutes - press Ctrl-C to finish early'

    bar = ProgressBar(60)
    try:
        event = Event()
        for i in range(60):
            bar.show(i)
            event.wait(3)
        bar.finish()
        os.system('say "time is up, stop boggling"')
    except KeyboardInterrupt:
        pass

    raw_input('\nPress <ENTER> to see answers')

    results = board_search(board, trie)
    answers = Answers()
    answers.add(results)

    print answers