Diff
Not logged in

Differences From Artifact [b38729b48307e77e]:

To Artifact [dde2fe1d85562c17]:


335 { 335 { 336 int bp = max(0, (cast(int)plan.length)-10); 336 int bp = max(0, (cast(int)plan.length)-10); 337 Game g = ini.clone(); 337 Game g = ini.clone(); 338 for(int i=0; i<bp; ++i) g.command(plan[i]); 338 for(int i=0; i<bp; ++i) g.command(plan[i]); 339 339 340 Tuple!(string,long) cand = tuple(plan, unmod); 340 Tuple!(string,long) cand = tuple(plan, unmod); 341 for(int i=bp; i<plan.length; ++i) { 341 for(int i=bp; i<plan.length; ++i) { 342 foreach(char c; "UDLR") | 342 foreach(string c; ["U","D","L","R","UD","DU","LR","RL"]) 343 if(c != plan[i]) { | 343 if(c[0] != plan[i]) { 344 Tuple!(string,long) zz = try_plan(c, g); 344 Tuple!(string,long) zz = try_plan(c, g); 345 if(cand[1]<zz[1]) 345 if(cand[1]<zz[1]) 346 cand = tuple(plan[0..i]~c~zz[0], 346 cand = tuple(plan[0..i]~c~zz[0], 347 } 347 } 348 g.command(plan[i]); 348 g.command(plan[i]); 349 } 349 } 350 plan = cand[0]; 350 plan = cand[0]; 351 } 351 } 352 352 353 Tuple!(string,long) try_plan(char c, in Game g) | 353 Tuple!(string,long) try_plan(string c, in Game g) 354 { 354 { 355 Game gg = g.clone(); 355 Game gg = g.clone(); 356 gg.command(c); | 356 foreach(cc;c)gg.command(cc); 357 Tuple!(Solver, string) x = run_sub_solver(gg); 357 Tuple!(Solver, string) x = run_sub_solver(gg); 358 return tuple(x[1], x[0].g.score); 358 return tuple(x[1], x[0].g.score); 359 } 359 } 360 360 361 char single_step() { 361 char single_step() { 362 if(plan.empty) 362 if(plan.empty) 363 return 'A'; 363 return 'A';