Jumbled word puzzle helper

I enjoy the jumble word puzzle in the newspaper. I have discovered that if I imagine the first and last letter in their correct positions I can usually figure out the word. This script prints all the combinations such that: every two letters from the word takes a turn on the beginning and end of a word with all the other letters sandwiched in between in no particular order.

The scrambled words in the word puzzle are usually small. This technique doesn't work very well for me with large words.

I could have, of course, printed all permutations of the given string, but that would have resulted in substantially more words. Plus, that probably crosses the line into 'jumble cheating'. And we can't have that. Enter a mixed up word below and click the button.




Scripts