Example #1
0
def main():
    dictFile = file("words.pickle")
    dict = pickle.load(dictFile)
    jumbles = []
    i = 0
    while 1:  # Get jumbles from the user and process them
        j = Jumble()
        j.original = raw_input("Next jumbled word: ")
        if j.original == "":
            break
        positions = raw_input("Important positions in this word: ")
        j.positions = positions.split(",")
        for i in range(0, len(j.positions)):
            j.positions[i] = int(j.positions[i])
            j.positions[i] = j.positions[i] - 1

        j.agrams = findWord(j.original, dict)
        jumbles.append(j)
        i += 1

    solve(jumbles, dict)