Diff
Not logged in

Differences From Artifact [a41fda48c5fe0806]:

To Artifact [accda2201a6a857e]:


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) {