@@ -8,9 +8,9 @@ } class Solver_1 { - int g_wc = 0; + int wait_count = 0; Game g; this(const(Game) g) { @@ -64,16 +64,25 @@ return c1[1] < c2[1]; return c1[0] < c2[0]; })(cand); c = cand[0][0]; + + if(death.count(c)) { + foreach(char live; "UDLRWA") + if(death.count(live)==0) { + c=live; + break; + } + } if(c=='W') { - g_wc++; - if(g_wc > 10) + wait_count++; + if(wait_count > g.map.H) c = 'A'; } else - g_wc = 0; + wait_count = 0; + bool[char] choice; foreach(t; cand) choice[t[0]] = true; log ~= tuple(ro.clone(), cast(int)choice.length);