Log in

View Full Version : Pocket Excel guru?


terrypin
06-08-2007, 09:45 AM
While on holiday recently I was given a sheet of about 50 anagrams to work out. Like

DOECARROT (Answer: DECORATOR)
PETRESCUE
TALKSENSH
FETIDSITE
GUNGIBILE
etc

In the evenings, in between walking the coastal paths of Cinque Terre in Northern Italy, I spent far too many hours at these, managing to solve about 15 of them. After some time my thoughts turned towards cheating. I had my iPAQ 2210 Pocket PC with me, and it has Pocket Excel installed. It's very limited by comparison with my PC's Excel 2000. No VBA macros for example. But I set about trying to write a spreadsheet which would let me enter e.g. PETRESCUE and see say 20 random anagrams, click a button or press a key and see another 20, and so on. Even if not delivering the answer itself (there are nearly 370,000 permutations of a 9 character word!), I thought it might be helpful. Rather like shuffling your 7 Scrabble letters to get inspiration.

But I quickly came across what seems a major obstacle. Using the RAND() function (as part of this) inevitably gives a 'repetitive' result. For example, if I developed 9 digit numbers (with the aim of using them to shuffle the original 9 letters around), they would be like 981245331, 123467238, 331245678, etc. IOW, one or more digits would often be repeated.

So ... can anyone suggest a method of developing a set of 9 digit numbers with no repetition? Or, of course, solving the problem directly, i.e. developing a set of unique anagrams of a 9 character string?

--
Terry, West Sussex, UK

JonMisurda
06-10-2007, 05:49 PM
In order to do that, you'd need to have a loop structure, which pocket excel doesn't provide. (Note: yes you could unwind the loop, but I'd bet the resulting code would be larger than the cell is allowed to contain.)

Try this program I quickly wrote: http://www.cs.pitt.edu/~jmisurda/ppc/anagram.exe

Just copy to your device. You can paste into the textbox using CTRL+V

Jon