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                                  Pos[] q2;                                            225                                  Pos[] q2;
  226                                  foreach(p; q) {                                      226                                  foreach(p; q) {
  227                                          int[] yyy=[p.y-1,p.y+1,p.y,p.y];             227                                          int[] yyy=[p.y-1,p.y+1,p.y,p.y];
  228                                          int[] xxx=[p.x,p.x,p.x-1,p.x+1];             228                                          int[] xxx=[p.x,p.x,p.x-1,p.x+1];
  229                                          for(int i=0; i<yyy.length; ++i) {            229                                          for(int i=0; i<yyy.length; ++i) {
  230                                                  int y = yyy[i];                      230                                                  int y = yyy[i];
  231                                                  int x = xxx[i];                      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)]!
                                                                                        >   236                                                  }
  232                                                  if('1'<=g.map[y,x]&&g.map[y,x]<=     237                                                  if('1'<=g.map[y,x]&&g.map[y,x]<=
  233                                                          foreach(ppp; g.map.tr_so     238                                                          foreach(ppp; g.map.tr_so
  234                                                                  yyy ~= ppp.y;        239                                                                  yyy ~= ppp.y;
  235                                                                  xxx ~= ppp.x;        240                                                                  xxx ~= ppp.x;
  236                                                          }                            241                                                          }
  237                                                          continue;                    242                                                          continue;
  238                                                  }                                    243                                                  }
  239                                                  if(v[y][x]) continue;                244                                                  if(v[y][x]) continue;
  240                                                  if(y==s.y && x==s.x && i<4) {        245                                                  if(y==s.y && x==s.x && i<4) {
  241                                                          char c = "UDRL"[i];          246                                                          char c = "UDRL"[i];
  242                                                          if( death.count(c) == 0      247                                                          if( death.count(c) == 0 
  243                                                                  return [tuple(c,     248                                                                  return [tuple(c,
  244                                                  } else if(forbidden_cell[y][x]){     249                                                  } else if(forbidden_cell[y][x]){
  245                                                  } else if(g.map[y,x]==' '||g.map |   250                                                  } else if(g.map[y,x]==' '||g.map
  246                                                          q2 ~= new Pos(y,x);      <
  247                                                          v[y][x]=true;            <
  248                                                  } else if(i<4 && (y-p.y)==0 && g <
  249                                                          q2 ~= new Pos(y,x);          251                                                          q2 ~= new Pos(y,x);
  250                                                          v[y][x]=true;                252                                                          v[y][x]=true;
  251                                                  }                                    253                                                  }
  252                                          }                                            254                                          }
  253                                  }                                                    255                                  }
  254                                  q = q2;                                              256                                  q = q2;
  255                          }                                                            257                          }