Index: score_memo.txt ================================================================== --- score_memo.txt +++ score_memo.txt @@ -17,10 +17,10 @@ trampoline2 1728? trampoline3 698 // "上に岩" ワープゾーン版 beard1 856? beard2 2792 // 崩すの怖がりすぎて間に合わなくなって溺死 beard3 811 // 無理ゲー:速攻で髭刈らないといけない -beard4 677 // 岩が落ちてきてデッドエンド +beard4 1950 // 髭を解放しないように動くゲー beard5 665 // これクリアできるの horock1 333 horock2 235 horock3 1542 Index: src/solver.d ================================================================== --- src/solver.d +++ src/solver.d @@ -315,37 +315,51 @@ } } class Solver_2(SubSolver) : Solver { - static const PredictFuture = 10; + // Parameters. + static const PredictFuture = 10; + const string[] RandomChoicePattern; // PF*RCP exhaustive search for RL steps + const ReplanLength = 400; // O(PF*RCP*RL*SubSolver.single_step) Game current_game; SubSolver sub_solver; enum {Tentative, Tentative_Stuck, Fixed}; string plan; int plan_state; + int replan_limit; this(in Game g) { current_game = g.clone(); plan = ""; plan_state = Tentative; + replan_limit = PredictFuture; + if(g.map.W*g.map.H <= 400) + RandomChoicePattern = ["UU","UD","UL","UR", + "DU","DD","DL","DR", + "LU","LD","LL","LR", + "RU","RD","RL","RR","UUU","UUUU","UUUUU"]; + else if(g.map.W*g.map.H <= 4096) + RandomChoicePattern = ["UUU","U","D","L","R","UD","DU","LR","RL"]; + else + RandomChoicePattern = ["U","D","L","R"]; } char single_step() { if(current_game.dead || current_game.cleared) return 'A'; // Make enough prediction. - while( plan_state==Tentative && plan.length