bostonpythonworkshop / Wordplay

0 stars 0 forks source link

Worldplay ignores if you use upper-case letters #5

Open OwNumero opened 11 years ago

OwNumero commented 11 years ago

1-Conditions: Run wordplay, enter a batch of letters with upper case letters, example: "AgraE" Detailed instructions to reproduce: -open Git Bash -type python scrabble_cheater.py AgraE 2-Expected results: Wordplay gives you possible words from a subset of all the letters 3-Actual results: Wordplay only offers words with the lower cases letters, ignoring the upper case letters

tomleo commented 11 years ago

Idea for fix:

diff --git a/scrabble_cheater.py b/scrabble_cheater.py
index c225ef4..66ad81a 100644
--- a/scrabble_cheater.py
+++ b/scrabble_cheater.py
@@ -6,7 +6,7 @@ if __name__ == "__main__":
         print >>sys.stderr, "Usage: scrabble.py [RACK]"
         sys.exit(1)

-    rack = list(sys.argv[1])
+    rack = list(sys.argv[1].lower())
     valid_words = []

     for word in wordlist: