artist has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks
I have a design and algorithm problem. I am looking for efficient ways to solve this problem which is a part of game programming.

Given the word: I would like to find another words which try to maximize fit above or below the given word so that all the words created by columns also constitute 2 letter words.

ex.

  PAN
 RATES
Above is just an example when the word PAN given and one of the 'below' answer is 'RATES' ( I have a set of 2 letter words which includes PA, AT,NE,TO,IN,AN etc..)

Restrictions can be imposed as a set of rules for finding the answer. Rules could be like ..
1. No repeat letters
2. Construct the answers only from specific letters
3. More letters are better etc.

'Above' and 'Below are just one of the 'patterns'. Other could be like this

 
 APE
 RATE
 ENS
Where RAT is a word which can come under 'Between' pattern, given the words 'APE' and 'ENS' as where they are.

If this is not the right place to post let me know. Also in that case, I think that we should start 'design and algorithm' section here, which can definitely steer coding in the right direction. Internet links to other places for such discussion would be helpful too.

Desiging
an
artist

Replies are listed 'Best First'.
Re: Words Fun
by artist (Parson) on Nov 11, 2002 at 14:41 UTC
    Hi

    As mentioned by aristotle I am trying to re-phrase the question.
    Let's say I have a word-1, PAN.
    I would like to find words which can match the pattern
    Each column should constitue 2 letter Valid words pre-defined
    The number of * can be from 2 to 7, more the better.

     PAN	 
     *******   
    

    Valid Examples:
    PAN
    ARE
    
     PAN
    RATE
    
     PAN
      PA
    
    Assum here that I have words PA AR NE AT ARE RATE etc are pre-defined.
    Invalid exmaple:
     PAN
     SKY
    
    The words PS and NY ae not pre-defined.

    Hope it makes sense now.


    Thanks,
    Artist.