Differences From Artifact [d8cdcee0dd6dc539]:
- File
src/solver.d
- 2012-07-14 18:33:18 - part of checkin [ea96f24715] on branch trunk - Introduced choke_count to cumlatively count the robot chose to "wait" (user: kinaba) [annotate]
To Artifact [673d840a0e1a2769]:
- File
src/solver.d
- 2012-07-14 18:50:00 - part of checkin [faa7422a78] on branch trunk - now the robot can push the rock and turn left/right. (user: kinaba) [annotate]
225 225 Pos[] q2;
226 226 foreach(p; q) {
227 227 int[] yyy=[p.y-1,p.y+1,p.y,p.y];
228 228 int[] xxx=[p.x,p.x,p.x-1,p.x+1];
229 229 for(int i=0; i<yyy.length; ++i) {
230 230 int y = yyy[i];
231 231 int x = xxx[i];
232 + if(g.map[p] == '*') {
233 + if(i>=4)continue;
234 + if(y!=p.y)continue;
235 + if(g.map[y,p.x+(p.x-x)]!=' '&&g.map[y,p.x+(p.x-x)]!='R')continue;
236 + }
232 237 if('1'<=g.map[y,x]&&g.map[y,x]<='9') {
233 238 foreach(ppp; g.map.tr_source[g.map[y,x]]) {
234 239 yyy ~= ppp.y;
235 240 xxx ~= ppp.x;
236 241 }
237 242 continue;
238 243 }
239 244 if(v[y][x]) continue;
240 245 if(y==s.y && x==s.x && i<4) {
241 246 char c = "UDRL"[i];
242 247 if( death.count(c) == 0 )
243 248 return [tuple(c,step)];
244 249 } else if(forbidden_cell[y][x]){
245 - } else if(g.map[y,x]==' '||g.map[y,x]=='\\'||g.map[y,x]=='.'||i>=4) {
246 - q2 ~= new Pos(y,x);
247 - v[y][x]=true;
248 - } else if(i<4 && (y-p.y)==0 && g.map[p]==' ' && g.map[y,x]=='*' && (g.map[y+(y-p.y),x+(x-p.x)]==' '||g.map[y+(y-p.y),x+(x-p.x)]=='R')) {
250 + } else if(g.map[y,x]==' '||g.map[y,x]=='\\'||g.map[y,x]=='.'||g.map[y,x]=='*'||i>=4) {
249 251 q2 ~= new Pos(y,x);
250 252 v[y][x]=true;
251 253 }
252 254 }
253 255 }
254 256 q = q2;
255 257 }