ADDED maps/test2.map Index: maps/test2.map ================================================================== --- maps/test2.map +++ maps/test2.map @@ -0,0 +1,6 @@ +* L + W +* +#R# + +Growth 2 ADDED maps/test3.map Index: maps/test3.map ================================================================== --- maps/test3.map +++ maps/test3.map @@ -0,0 +1,8 @@ +L * CD + * \B 2 + R A1 + +Trampoline A targets 1 +Trampoline B targets 1 +Trampoline C targets 1 +Trampoline D targets 2 Index: src/game.d ================================================================== --- src/game.d +++ src/game.d @@ -392,12 +392,15 @@ } else if(this[p]=='W') { if(hige_day) { for(int dy=-1; dy<=+1; ++dy) for(int dx=-1; dx<=+1; ++dx) - if(this[p.y+dy,p.x+dx] == ' ') + if(this[p.y+dy,p.x+dx] == ' ') { write(p.y+dy,p.x+dx,'W'); + if(robot.y==p.y+dy-1 && robot.x==p.x+dx) + dead = false; // guarded by hige! + } } } } return dead; Index: src/solver.d ================================================================== --- src/solver.d +++ src/solver.d @@ -341,11 +341,11 @@ RandomChoicePattern = ["UU","UD","UL","UR", "DU","DD","DL","DR", "LU","LD","LL","LR", "RU","RD","RL","RR","UUU","UUUU","UUUUU"]; PredictFuture = 20; - clear_improvement = 3; + clear_improvement = 1; } else if(g.map.W*g.map.H <= 4096) { RandomChoicePattern = ["UUU","U","D","L","R","UD","DU","LR","RL"]; PredictFuture = 10; clear_improvement = 0; @@ -373,11 +373,10 @@ replan(); // Follow the predicted plan. if( plan.empty ) return 'A'; -stderr.writeln(plan, " ", plan_state); char c = plan[0]; plan = plan[1..$]; int b_lambda = current_game.map.collected_lambda; current_game.command(c); int a_lambda = current_game.map.collected_lambda; @@ -427,16 +426,14 @@ } } void replan() { -stderr.writeln("replan!"); // Try to replace every step of the plan by another move. Game g = current_game.clone(); Tuple!(SubSolver, string, int) cand = tuple(sub_solver, plan, Tentative_Stuck); int insertion_point = plan.length; -writeln(cand, " ", cand[0].g.map.collected_lambda); bool tiebreak_by_turn = false; int consider_length = min(ReplanLength, g.map.W*g.map.H); if(cand[0].g.cleared) consider_length = min(consider_length, cand[1].length); for(int i=0; i