Lines Matching refs:mm
47 makmove(struct move *mm, int i)
52 d = mm->d0;
53 n = abs(mm->g[i] - mm->p[i]);
55 if (board[mm->p[i]] * cturn <= 0)
56 return (checkd(mm, d) + 2);
57 if (mm->g[i] != home && board[mm->g[i]] * cturn < -1)
58 return (checkd(mm, d) + 3);
59 if (i || mm->D0 == mm->D1) {
60 if (n == max ? mm->D1 < n : mm->D1 != n)
61 return (checkd(mm, d) + 1);
63 if (n == max ? mm->D0 < n && mm->D1 < n : mm->D0 != n && mm->D1 != n)
64 return (checkd(mm, d) + 1);
65 if (n == max ? mm->D0 < n : mm->D0 != n) {
66 if (mm->d0)
67 return (checkd(mm, d) + 1);
68 mswap(mm);
71 if (mm->g[i] == home && *offptr < 0)
72 return (checkd(mm, d) + 4);
73 mm->h[i] = 0;
74 board[mm->p[i]] -= cturn;
75 if (mm->g[i] != home) {
76 if (board[mm->g[i]] == -cturn) {
78 board[mm->g[i]] = 0;
79 mm->h[i] = 1;
80 if (abs(bar - mm->g[i]) < 7) {
86 board[mm->g[i]] += cturn;
87 if (abs(home - mm->g[i]) < 7 && abs(home - mm->p[i]) > 6) {
100 moverr(struct move *mm, int i)
110 wrint(mm->p[j]);
112 wrint(mm->g[j]);
117 movback(mm, i);
122 checkd(struct move *mm, int d)
124 if (mm->d0 != d)
125 mswap(mm);
141 movback(struct move *mm, int i)
146 backone(mm, j);
150 backone(struct move *mm, int i)
152 board[mm->p[i]] += cturn;
153 if (mm->g[i] != home) {
154 board[mm->g[i]] -= cturn;
155 if (abs(mm->g[i] - home) < 7 && abs(mm->p[i] - home) > 6) {
164 if (mm->h[i]) {
166 board[mm->g[i]] = -cturn;
167 if (abs(bar - mm->g[i]) < 7) {