In the example below the letters shall be replaced by numbers. The numbers are from 1 to 9, and each letter has the same number (e.g. E = 4 all the time. Different letters must have different numbers, so E = W = 4 is not allowed):

If one choose e.g. E = 4 (and some other numbers for the other letters), it can be easily seen that

is not a correct solution because E is in the first two rows 4 but not in the third row!
After some attempts I found that

is a solution.
I know that there are also some other solutions which solve this problem correctly. So, my question is: How can I find with Mathematica (9.0.1) ALL possible solutions?
My approach is the following: I create an array with all possible combinations:
values =
Table[{(z*1000 + w*100 + e*10 + i), (v*1000 + i*100 + e*10 + r),
(z*1000 + w*100 + e*10 + i) + (v*1000 + i*100 + e*10 + r)},
{z, 1, 9}, {w, 1, 9}, {e, 1, 9}, {i, 1, 9}, {v, 1, 9}, {r,1, 9}];
And then I want to search in the array values for the correct combinations. But I have some problems to write a nice searching-program for this. Could anybody help?
I also have doubts if it is a good idea to create such a big values-array because I create numbers like 1111 which are forbidden. Is there a way that I can create a leaner array?
Or does anybody have another nice idea how I could find all correct solutions for this problem?
I would be very happy about any help!

sol[[301]]) it would be: e = i = 5. But this is not allowed too (I will make this more clear in my question). How can I get rid of these wrong solutions? – partial81 Jan 21 '14 at 16:05Select[sol, Unequal @@ # &]would fix that – Rojo Jan 21 '14 at 17:03Solvesometimes appears to be less smarter than Reduce (see e.g. this answer How to get intersection values from a parametric graph? which I couldn't solve withSolve) while it is still smarter thanEliminate(see e.g. this Efficient code for solve this equation). – Artes Jan 21 '14 at 18:221to9", though simple modification of this approach would yield more general solutions. It's slightly misleading when the OP is not sure what he is looking for. – Artes Jan 21 '14 at 18:56e=wis not allowed, I thought this is obvious. To the1to9or0to9problem: I am not unsure about this ;-) The book from where I have this mind game uses1to9. I guess, it does this because it is then a bit more difficult to find a solution by mind (only 6 possibilities instead of 14 or 46). Anyway, thanks again for your help! I learned much about writing nice code and I hope you and others had fun with this game;-) – partial81 Jan 21 '14 at 21:431to9One could consider also a bit more involved problem how the number of solutions depends on different permutations of variables{z, w, e, i, v, r, f, u, n}in the initial equations. I find this problem interesting as well. – Artes Jan 21 '14 at 23:061to9in the post. Now you can extend your answer to other bases than decimal :) – István Zachar Jan 22 '14 at 12:55