SHOW:
|
|
- or go back to the newest paste.
1 | public void updateDomains(Tile t1, Tile t2){ | |
2 | - | public void updateDomains(Tile t1, Tile t2){ |
2 | + | |
3 | for(int value:t1.domain.domain){ | |
4 | t1.setValue(value); | |
5 | for(int t2.x = 0; t2.x < size; t2.x++) { | |
6 | for (int t2.y = 0; t2.y < size; t2.y++) { | |
7 | if (t2.x != t1.x || t2.y != t1.y) { | |
8 | if (!con.checkconsistency(t1, t2)) | |
9 | - | for (int k = 1; k < n; k++) { |
9 | + | t1.domain.deleteElement(k); |
10 | - | t1.setValue(k); |
10 | + | |
11 | - | if (!con.checkconsistency(t1, t2)) |
11 | + | |
12 | - | t1.domain.deleteElement(k); |
12 | + | |
13 | } | |
14 | t1.setValue(null); | |
15 | t2.setValue(null); | |
16 | if(n == 0) | |
17 | t2.domain.deleteElement(value); | |
18 | ||
19 | } | |
20 | ||
21 | } |