[Java!] [Sourcecode] [Executable]


All this program does is rearrange a word and list all the unique permutations. For example "DOG" would be converted to "DOG", "DGO", "ODG", "OGD", "GDO", "DOG". You can also search this list for words containing a certain sequence of characters, i.e. it is possible to find the number of 5 letter words containing OO from 'LONDON'. The answer is 48.

Why I did it

We were having a slightly off-syllabus conversation about this sort of problem in a statistics lesson once. I suggested I could write a program that would list them all, went home that night, wrote it and we spent the next maths lesson trying different words with it.

Other info

The first java program I ever wrote was based on this. It was an applet, and hopefully here it is:

The code was largely pinched from a prime number generator, and is by no means well-written. I doubt I will return to Swing for a long time, at least until I am a lot more proficient at jbuilder and Java.