Commits

Ed Brannin committed 42d4642

moar

Comments (0)

Files changed (1)

     return
   total = score/len(word)
   unknown = ""
-  print "%(points)d points in the letters of '%(word)s'." % dict(points=total, word=word)
+  #print "%(points)d points in the letters of '%(word)s'." % dict(points=total, word=word)
   for letter in word:
     try:
       total -= letters[letter]
-      print "%(points)d points for %(letter)s" % dict(points=letters[letter], 
-          letter=letter)
+      #print "%(points)d points for %(letter)s" % dict(points=letters[letter], 
+      #    letter=letter)
     except KeyError:
-      print "No score known for %(letter)s." % dict(letter=letter)
+      #print "No score known for %(letter)s." % dict(letter=letter)
       unknown += letter
-  print "Remaining: %(total)d points for %(unknown)s." % dict(total=total, unknown=unknown)
+  if len(unknown) == 0 and total == 0:
+    print "Solved for the word: %s" % word
+  else:
+    print "Remaining: %(total)d points for %(unknown)s." % dict(total=total, unknown=unknown)
 
 if __name__ == "__main__":
   for word, value in dict(