Differences From Artifact [a41fda48c5fe0806]:
- File
src/solver.d
- 2012-07-16 07:24:55 - part of checkin [9fd05a2326] on branch trunk - better integrated horo-push. (user: kinaba) [annotate]
To Artifact [accda2201a6a857e]:
- File
src/solver.d
- 2012-07-16 08:06:06 - part of checkin [3893826f55] on branch trunk - dangerness loosened. (user: kinaba) [annotate]
288 288 }
289 289
290 290 return c;
291 291 }
292 292
293 293 Tuple!(char,int)[] search(in Game g, in Pos s, in Pos[] gs, string death, bool danger_ok=false)
294 294 {
295 + bool very_danger(int y, int x)
296 + {
297 + if(g.map[y,x] == ' ' || g.map[y,x] == 'R')
298 + return false;
299 + if(is_rocky(g.map[y+1,x]))
300 + return true;
301 + return false;
302 + }
295 303 bool danger(int y, int x)
296 304 {
297 305 if(g.map[y,x] == ' ' || g.map[y,x] == 'R')
298 306 return false;
299 307 if(is_rocky(g.map[y+1,x]))
300 308 return true;
301 309 if(is_rocky(g.map[y+1,x-1]) && (g.map[y,x-1]=='\\'||is_rocky(g.map[y,x-1]))
................................................................................
311 319 return false;
312 320 }
313 321
314 322 // avoid directly below '*'
315 323 Tuple!(char,int)[] tryA() {
316 324 const(Pos)[] q;
317 325 foreach(p; gs)
318 - if(!danger(p.y,p.x))
326 + if(!very_danger(p.y,p.x))
319 327 q ~= p;
320 328 bool[][] v = new bool[][](g.map.H+2, g.map.W+2);
321 329 foreach(p; q) v[p.y][p.x]=true;
322 330 bool first_step = true;
323 331 for(int step=1; q.length; ++step) {
324 332 Pos[] q2;
325 333 foreach(p; q) {