in reply to Words that equal numbers
There are some constraints to apply before you start, such as "leading zeros are not allowed", and "only a one is ever carried from the sum of two digits plus a possible carry" so:
I once implemented a solution for a peg-jumping game in perl by keeping a stack of game states, and doing all possible next jumps to make a stack of all possible next states, and so on. In your case a "move" would be the choice of another digit-to-letter assignment.B != 0 J != 0 A != 0 D + S = T or (T + 10)
Test each partial solution for impossibilities and eliminate it from the list as soon as you can, so the problem does not grow exponentially.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Words that equal numbers
by Anonymous Monk on Jan 18, 2003 at 00:45 UTC | |
by tall_man (Parson) on Jan 18, 2003 at 01:03 UTC |