S
Stuart Moore
A bit of a poser for anyone bored:
I was chatting with some friends, and we were trying to work out
suitable strings of letters which could have spaces and punctuation in
different places to produce different sentences
e.g.
Therestopenlarge
parses to
There stop enlarge
or
The rest open large
Anyone have an idea of a good perl program to work these out? My
thoughts so far involved grabbing words from /usr/share/dict/words (or
whatever the equivalent is on your system) and loading them into a hash
so it's quick to see if foo is a word; choosing one at random (e.g.
there); trying to find a subword (e.g. the), then looking for a word
starting with the difference (e.g. re.*) until you end up with a
suitable string. Then repeat.
My hope is to find some that make sense, but I'm not optimistic.
Hope that some of you are interested by the challenge.
I was chatting with some friends, and we were trying to work out
suitable strings of letters which could have spaces and punctuation in
different places to produce different sentences
e.g.
Therestopenlarge
parses to
There stop enlarge
or
The rest open large
Anyone have an idea of a good perl program to work these out? My
thoughts so far involved grabbing words from /usr/share/dict/words (or
whatever the equivalent is on your system) and loading them into a hash
so it's quick to see if foo is a word; choosing one at random (e.g.
there); trying to find a subword (e.g. the), then looking for a word
starting with the difference (e.g. re.*) until you end up with a
suitable string. Then repeat.
My hope is to find some that make sense, but I'm not optimistic.
Hope that some of you are interested by the challenge.