Overview
SHA1 Hash: | fa2f8e21f20deaf1f39370c573776151808577e7 |
---|---|
Date: | 2012-07-16 07:57:43 |
User: | kinaba |
Comment: | messages to stderr. |
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 [4176698dd9ba368b] to [469e63844195a7a0].
345 // If the future is bad, correct. 345 // If the future is bad, correct. 346 if( plan_state==Tentative_Stuck && plan.length<PredictFuture ) 346 if( plan_state==Tentative_Stuck && plan.length<PredictFuture ) 347 replan(); 347 replan(); 348 348 349 // Follow the predicted plan. 349 // Follow the predicted plan. 350 if( plan.empty ) 350 if( plan.empty ) 351 return 'A'; 351 return 'A'; 352 writeln(plan, " ", plan_state); | 352 stderr.writeln(plan, " ", plan_state); 353 char c = plan[0]; 353 char c = plan[0]; 354 plan = plan[1..$]; 354 plan = plan[1..$]; 355 current_game.command(c); 355 current_game.command(c); 356 return c; 356 return c; 357 } 357 } 358 358 359 void force(char c) 359 void force(char c) ................................................................................................................................................................................ 388 plan_state = (sub_solver.g.dead ? Tentative_Stuck : 388 plan_state = (sub_solver.g.dead ? Tentative_Stuck : 389 sub_solver.g.cleared ? Fixed : Tentative); 389 sub_solver.g.cleared ? Fixed : Tentative); 390 } 390 } 391 } 391 } 392 392 393 void replan() 393 void replan() 394 { 394 { 395 writeln("replan!"); | 395 stderr.writeln("replan!"); 396 // Try to replace every step of the plan by another move. 396 // Try to replace every step of the plan by another move. 397 Game g = current_game.clone(); 397 Game g = current_game.clone(); 398 Tuple!(long, SubSolver, string, int) cand = 398 Tuple!(long, SubSolver, string, int) cand = 399 tuple(sub_solver.g.score, sub_solver, plan, Tentative_St 399 tuple(sub_solver.g.score, sub_solver, plan, Tentative_St 400 for(int i=0; i<plan.length; ++i) { 400 for(int i=0; i<plan.length; ++i) { 401 foreach(string prefix; ["U","D","L","R","UD","DU","LR"," 401 foreach(string prefix; ["U","D","L","R","UD","DU","LR"," 402 if(prefix[0] != plan[i]) { 402 if(prefix[0] != plan[i]) {