I need a program, help please

• 11-29-2009, 04:33 PM
Srcee
I need a program, help please
If someone can help me, I need a program in Java that will do the following:

find a solution for a numerical riddle. A numerical riddle is made of letters and signs for arithmetic operations (+,- and =), for example B+AB=BA
Different letters are for different digits. Same letters are for same digits. The solution of the riddle is making the letters into digits that will give a correct equation. For example, for the riddle AB+B=BA, the solution could be 89+9=98
The riddles are placed in a file, where every line of the file is one riddle.
The output should be every possible solution for every of the riddles of the file.
If the first digit of the statement is 0, the solution shouldn't be printed. For example, AB+B=C, one solution is 01+1=2, but it shouldn't be in the output.

If someone can help me, write me a private message please, I would prefer if you do not write in the thread.
• 11-29-2009, 04:44 PM
Fubarable
I'm sorry but that is not how this forum works. It is for sharing questions and solutions with all. As it is all you've done is post your assignment. If you have any specific questions, please post them as most all here would be more than happy to help you out.

Much luck.
• 11-29-2009, 05:17 PM
JosAH
Quote:

Originally Posted by Srcee
If someone can help me, write me a private message please, I would prefer if you do not write in the thread.

But why post here then? imho, if you post here you should read here. It's a nice little puzzle, why withhold others from reading nice little solutions?

kind regards,

Jos
• 11-29-2009, 05:18 PM
Fubarable
Quote:

Originally Posted by JosAH
But why post here then? imho, if you post here you should read here. It's a nice little puzzle, why withhold others from reading nice little solutions?
Jos

Much better stated than in my post. Thanks!
• 11-29-2009, 06:47 PM
JosAH
Quote:

Originally Posted by Fubarable
Much better stated than in my post. Thanks!

You're welcome of course; why not make this riddle a little contest? I can generate combinations and permutations (thereof) so the rest of the riddle shouldn't be much of a problem: just let the Javascript engine do the hard work ;-)

kind regards,

Jos
• 11-29-2009, 09:15 PM
JosAH
For teasers: my implementation finds the following solutions for ABCDE/FG == HIJ:

Code:

```58401/63==927 26910/78==345 17820/36==495 17820/45==396 16038/27==594 16038/54==297 15678/39==402 19084/52==367 32890/46==715```
kind regards,

Jos ;-)