Diff
Not logged in

Differences From Artifact [4f413ed4f5088aec]:

To Artifact [dca756d0b000be21]:


53 Tuple!(char,int)[] cand; 53 Tuple!(char,int)[] cand; 54 char c = 'W'; 54 char c = 'W'; 55 if( la.empty ) { 55 if( la.empty ) { 56 cand = search(g, ro, [li], death); 56 cand = search(g, ro, [li], death); 57 } else { 57 } else { 58 cand ~= search(g, ro, la, death); 58 cand ~= search(g, ro, la, death); 59 } 59 } > 60 if(cand.empty) { > 61 const(Pos)[] tgt; > 62 for(int y=1; y<=g.map.H; ++y) > 63 for(int x=1; x<=g.map.W; ++x) > 64 if(g.map[y,x]=='.') > 65 if(g.map[y+1,x]=='*'||g.map[y+1,x-1]=='* > 66 ||g.map[y,x+1]=='*'||g.map[y,x-1]=='*') > 67 tgt ~= new Pos(y,x); > 68 cand ~= search(g, ro, tgt, death); > 69 } > 70 > 71 if(cand.empty) 60 cand ~= tuple('W',int.max); | 72 cand ~= tuple('W',int.max); 61 sort!((Tuple!(char,int) c1, Tuple!(char,int) c2){ 73 sort!((Tuple!(char,int) c1, Tuple!(char,int) c2){ 62 if(c1[1] != c2[1]) 74 if(c1[1] != c2[1]) 63 return c1[1] < c2[1]; 75 return c1[1] < c2[1]; 64 return c1[0] < c2[0]; 76 return c1[0] < c2[0]; 65 })(cand); 77 })(cand); 66 c = cand[0][0]; 78 c = cand[0][0]; 67 79