Skip to content

Instantly share code, notes, and snippets.

@lukasvermeer
Created March 2, 2013 11:01
Show Gist options
  • Save lukasvermeer/5070529 to your computer and use it in GitHub Desktop.
Save lukasvermeer/5070529 to your computer and use it in GitHub Desktop.
Find words for the game 4 Pics 1 Word. Takes a bunch of letters ("elnopq" in this case) and prints four letter words that can be formed using a subset of those letters.
perl -ne 'if((join "",sort split(//,lc))=~/^\s*e?l?n?o?p?q?$/&$_=~/^\w{4}$/){print $_};' /usr/share/dict/words
@breun
Copy link

breun commented Mar 2, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment