Skip to content

Instantly share code, notes, and snippets.

@justinpage
Last active December 24, 2022 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinpage/64eef70ecd0f49cc983487f838fe8323 to your computer and use it in GitHub Desktop.
Save justinpage/64eef70ecd0f49cc983487f838fe8323 to your computer and use it in GitHub Desktop.

Family loves playing the following game:

scramble

While I was visiting them it go me thinking that you could use the command lines built in dictionary.

And by using that you can use your trusty grep to find matches

grep -v '[^nossle]' /usr/share/dict/words | egrep -x '.{6,6}'

By doing an invert on a select of nots (in another words match words that have these letters) and then piping it into a fixed string length, you can get the answer:

lessee
lessen
lesson
loosen
nelson
nonene
oleose
seesee
snoose
sossle

e.g. lesson

So next time you see someone struggling, you have a little tool to help.

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