A slightly friendlier permutations page

I came back to the permutations page and gave it a textbox and a button. It is a small improvement, but changing the address every time I want to try a different string gets old.

The algorithm is still the same recursive one: pick each character in turn, permute the rest, and collect the completed strings in an object so duplicates collapse together. The difference is in the page around it. Now I can type a value, click Go, and replace the results in the document without navigating to a new URL.

Repeated letters are a useful check. ABCD has twenty-four arrangements, while AABC has only twelve distinct ones. That makes it easy to spot whether the result set is actually doing its job. No new algorithm this time, just making the little experiment less awkward to use.

Open the updated permutations page