Skip to content
Webapp to solve scrambled words
Python JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
css
README.md
Screenshot.png
anagram.py
anargam.py
app.yaml
hello.py
img.png
jsFile.js
my.css
words.txt

README.md

Jumble words solver using Python and webapp2

Anargam

Live Demo

Doc

is_anagram:

def is_anagram(word1, word2):
    """Returns True if anagram is found. Else return False."""
    count = 0
    word1, word2 = list(word1), list(word2)  #get a list of charectors in the words
    if len(word1) == len(word2):             #match the dictionary word only if same length
          for i in word1:                    #removes a letter from the word and increase count
                   if i in word2:
                    word2.remove(i)
                    count += 1
          if count == len(word1):           #if count == lenght then its a match
               return True
    return False

anagramFind:

def anagramFind(wd_in):
    file = open('words.txt')              #open dictionary 
    wd_in=wd_in.lower();                  #make input string to lower case
    tmpString = ""                        #string of matched words
    found = 0
    for line in file:                     #loop through the dictionay
     if is_anagram(wd_in,line.strip()):
        found += 1
        tmpString += line.strip() + ", " 
    return tmpString, found

Run locally

Requrements: Python 2.7.10, google-cloud-sdk

git clone https://github.com/indrajithi/Jumble-words-Solver-using-webapp2

cd Jumble-words-Solver-using-webapp2/

dev_appserver .

If everything goes smooth the server will be up and running at http://localhost:8080/

You can’t perform that action at this time.