Check-in [faa7422a78]
Not logged in
Overview
SHA1 Hash:faa7422a78e59896206d6d7b06973328928d9967
Date: 2012-07-15 03:50:00
User: kinaba
Comment:now the robot can push the rock and turn left/right.
Timelines: family | ancestors | descendants | both | trunk
Diffs: redesign
Downloads: Tarball | ZIP archive
Other Links: files | file ages | manifest
Tags And Properties
Changes

Modified src/solver.d from [d8cdcee0dd6dc539] to [673d840a0e1a2769].

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 }