Up and down
One might be afraid of being forced to count all the time all these ends, but what actually happens is that the sum is just changed by the difference of the two ends of the domino moved. Example: with the 18-8 one got the difference 10; if moved to the right end, the sum increases by 10 – we count now 54 (three ends with 18):
If the same domino is moved instead to the end of 18, the sum decreases by 10 – now we count 34 points (three ends with 18 + 8 + 8). While trying to achieve a sum divisible by the divisor, one can always try two differences.