 |
Yanuth Newbie
Joined: 22 Feb 2006 Posts: 9
|
Posted: Fri Mar 03, 2006 9:43 am
Looping and Solving |
Let me start with the setup in this...
- I have 4 variable files, that each contain a list of 8 word-pieces
(VAR1, VAR2, VAR3, VAR4)
- I have 1 variable file with a list of possible solutions
(SOLV)
I am trying to find a non-redundant way of looping through the variables to see if they can create a solution from the SOLV variable.
It is bound to certain rules however, the SOLV word has to start with VAR1, then have a part of SOLV2, and then SOLV3 and then SOLV4.
Experience has shown that SOLV1 and SOLV4 can have an empty word-piece as an option which are shown as *
For example:
Code: |
#var VAR1 {NO|PRE|CON|*|EX|SEC|DO|WAS}
#var VAR2 {PHY|BLE|UN|HER|PLO|ZAR|BI|VALI}
#var VAR3 {COM|ANT|BEE|FOIL|GRAV|ABLE|OSE}
#var VAR4 {RUNN|*|FIL|Y|LIK|MON|FEY|WE}
#var SOLV {BEHIND|HEARSE|UNCOMMON|NORMAL|HOUSE} |
Which should yield the result UNCOMMON (empty from VAR1, UN from VAR2, COM from VAR3 and MON from VAR4)
There is no guarantee that the solution is in the SOLV variable, and, as mentioned, the combination of words can start AND finish (or either or neither) with the empty space
I can easily make a script that creates ALL possible combinations, which gives me 8*8*8*8 (4096) possible words, and compare each word against the SOLV variable-list
But on my older computer that lags the entire thing a bit...
I am sure it should be possible to create a script that loops through the first (and second (because of the empty space?)) variable and dismisses all SOLV-words that start with the wrong letter or word-piece and continue onwards in elimination-pattern
Ideally of course I would like to run the word-pieces against a dictionary to just find all words rather than the ones I have found myself so far, but that might be a bit extreme :)
As before, I hope this problem makes sense (my explanation of it anyway) :) |
|
|
 |
Yanuth Newbie
Joined: 22 Feb 2006 Posts: 9
|
Posted: Wed Mar 08, 2006 8:54 am |
No-one able to help me with this? 
|
|
|
 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Wed Mar 08, 2006 5:00 pm |
Ok... I'm a little confused as to what you are solve against. Are you trying to match one word or possible list of words in SOLV? If it's the former then the algorithm is fairly straightforward, if it's the latter then what are you trying to solve since you already have the resulting word. Are the word-fragments in VAR1 - VAR4 fixed? How do you determine the word you are trying to solve for? Also what do you mean by non-redundant?
If you answer these I can get a better understanding of what you want to do and give you a few leads. |
|
_________________ Asati di tempari! |
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|