Differences From Artifact [ec50c689624301b2]:
- File        
src/solver.d
- 2012-07-16 05:26:29 - part of checkin [6c02dd0cf0] on branch trunk - Minor change of BFS ordering. (user: kinaba) [annotate]
 
To Artifact [4eed871f814ba3b0]:
- File        
src/solver.d
- 2012-07-16 06:12:21 - part of checkin [84fb0102a2] on branch trunk - Minor parameter adjustment. (user: kinaba) [annotate]
 
  336                                                                                       336  
  337                  // any empty space is my ground                                      337                  // any empty space is my ground
  338                  Tuple!(char,int)[] tryB() {                                          338                  Tuple!(char,int)[] tryB() {
  339                          const(Pos)[] q;                                              339                          const(Pos)[] q;
  340                          foreach(p; gs) q ~= p;                                       340                          foreach(p; gs) q ~= p;
  341                          bool[][] v = new bool[][](g.map.H+2, g.map.W+2);             341                          bool[][] v = new bool[][](g.map.H+2, g.map.W+2);
  342                          foreach(p; q) v[p.y][p.x]=true;                              342                          foreach(p; q) v[p.y][p.x]=true;
  343                          for(int step=10; q.length; ++step) {                     |   343                          for(int step=8; q.length; ++step) {
  344                                  Pos[] q2;                                            344                                  Pos[] q2;
  345                                  foreach(p; q) {                                      345                                  foreach(p; q) {
  346                                          int[] yyy=[p.y-1,p.y,p.y,p.y+1];             346                                          int[] yyy=[p.y-1,p.y,p.y,p.y+1];
  347                                          int[] xxx=[p.x,p.x-1,p.x+1,p.x];             347                                          int[] xxx=[p.x,p.x-1,p.x+1,p.x];
  348                                          string sss="URLD";                           348                                          string sss="URLD";
  349                                          for(int i=0; i<yyy.length; ++i) {            349                                          for(int i=0; i<yyy.length; ++i) {
  350                                                  int y = yyy[i];                      350                                                  int y = yyy[i];
................................................................................................................................................................................
  697                          int[4] dy=[-1,+1,0,0];                                       697                          int[4] dy=[-1,+1,0,0];
  698                          int[4] dx=[0,0,-1,+1];                                       698                          int[4] dx=[0,0,-1,+1];
  699                          char[] ds=['D','U','L','R'];                                 699                          char[] ds=['D','U','L','R'];
  700                          for(int i=0; i<4; ++i) {                                     700                          for(int i=0; i<4; ++i) {
  701                                  if(g.map.robot==p && death.count(ds[i]))             701                                  if(g.map.robot==p && death.count(ds[i]))
  702                                          continue;                                    702                                          continue;
  703                                  int y=p.y+dy[i], x=p.x+dx[i];                        703                                  int y=p.y+dy[i], x=p.x+dx[i];
  704                                  if((g.map[y,x]==' '||g.map[y,x]=='\\'||g.map[y,x |   704                                  if((g.map[y,x]==' '||g.map[y,x]=='\\'||g.map[y,x
  705                                          Q.push(tuple(new Pos(y,x),p), dist+1);       705                                          Q.push(tuple(new Pos(y,x),p), dist+1);
  706                                  }                                                    706                                  }
  707                          }                                                            707                          }
  708                  }                                                                    708                  }
  709                                                                                       709  
  710                  return "";                                                           710                  return "";
  711          }                                                                            711          }