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
- branch=trunk inherited from [16f0b5784f]
- sym-trunk inherited from [16f0b5784f]
Changes
Modified src/solver.d from [4f413ed4f5088aec] to [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