Batch file get substring

March 12, 2011 at 05:38:35
Specs: Windows 7
A certain game utilizes a list of allowed words, in alphabetical order, that would look like a dictionary (without the definitions), once "decoded". A simple algorithm that minimizes repetition in the interest of keeping the list as short as possible is utilized, and can be easily recognized, given a small section of the list. What follows is the first few "words" of the list:
I'm trying to write a program that allows me to resolve the list into English, because, although easy to figure out from its beginning, trying to decipher words beginning with, say, the letters "arc" is a nightmare because each word is built from the one preceding it and there might be a thousand plus words between "aa" and "arc..."!
I'm trying to write a batch file to process this nightmare. I'd imagine you need to read in encoded words, separate the numerical piece of each word (if present) from the rest and use the number obtained to represent the number of characters from the last decoded word to be used to begin the word under construction, appending the remainder from the encoded form to give the resolved wo0rd, then proceed to the next word to resolve, etc., etc.
By the sound of my ramblings, you can be assured that i'm very confused, but besides that, have you any ideas, code-wise, on how to proceed?

See More: Batch file get substring

Report •

March 13, 2011 at 07:37:00
can be easily recognized, given a small section of the list.
But you see, I'm dumb. So spell it out for me.

How To Ask Questions The Smart Way

Report •

March 13, 2011 at 11:30:47
For such a highly repetitive word list as this would, by it's very nature be, the overall compression technique is extremely efficient. Aa, a type of lava, is actually the only word in the entire list that doesn't need translation - and its swiftly downhill from there!

aa aa
2h aah
3ed aahed
ing aahing
s aahs
2l aal
3iis aaliis
s aals
2rdvark aardvark
8s aardvarks
4wolf aardwolf
7ves aardwolves

and so on.
The starting point for words that begin with the letter "b" is easy enough to find. Because the first "b" word starts with none of the letters of the previous word, that line begins with a zero followed by the "as is" spelling of the word. All other words beginning with a "b" can be generated from that point on.

Report •

March 13, 2011 at 13:53:03
I must be dummer than I thought.

Life is too important to be taken seriously.


Report •
Related Solutions

Ask Question