#Anagram Maker import random import array wordlist=open("wordlist.txt","a") readit=open("wordlist.txt","r") iread=readit.read() word=raw_input("Please enter word to be anagramized: ") word = word.lower() pword = word + "\n" #Add new word to word list if it does not already exist #NOTE: Only use this for real words - else will create false positives if iread.find("\n" + pword) == -1: wordlist.write(pword) wordlist.close() word=word.replace("\n", "") newword = array.array('c') newword.fromstring(word) randused = [] i=0 #print len(word) while i < len(word): randnum=random.randrange(0, len(word)) if randnum not in randused: randused.append(randnum) #oldchar=word[i] newword[i]=word[randnum] i+=1 #newword[randnum]=oldchar print newword.tostring()