-
-
Save JimMackin/ed2f5da1d7b7a72ad786 to your computer and use it in GitHub Desktop.
Small script to play the reg plate game
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
if len(sys.argv) < 2: | |
print "Please provide a reg plate" | |
exit() | |
reg_plate = sys.argv[1].lower() | |
words = open('/usr/share/dict/words','r') | |
print "Words for: "+reg_plate | |
for word in words: | |
word = word.strip() | |
if word[0] == reg_plate[-3] and word[-1] == reg_plate[-1] and reg_plate[-2] in word[1:-1]: | |
print word |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment