Check-in [68c41bdbe0]
Not logged in
Overview
SHA1 Hash:68c41bdbe0d895015adee4db65a40cb0c6b3131a
Date: 2012-07-15 00:47:12
User: kinaba
Comment:Hori-Susumu kun.
Timelines: family | ancestors | descendants | both | trunk
Diffs: redesign
Downloads: Tarball | ZIP archive
Other Links: files | file ages | manifest
Tags And Properties
Changes

Modified src/solver.d from [4f413ed4f5088aec] to [dca756d0b000be21].

53 53 Tuple!(char,int)[] cand; 54 54 char c = 'W'; 55 55 if( la.empty ) { 56 56 cand = search(g, ro, [li], death); 57 57 } else { 58 58 cand ~= search(g, ro, la, death); 59 59 } 60 - cand ~= tuple('W',int.max); 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]=='*'||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) 72 + cand ~= tuple('W',int.max); 61 73 sort!((Tuple!(char,int) c1, Tuple!(char,int) c2){ 62 74 if(c1[1] != c2[1]) 63 75 return c1[1] < c2[1]; 64 76 return c1[0] < c2[0]; 65 77 })(cand); 66 78 c = cand[0][0]; 67 79