Skip to content

Commit

Permalink
Change all non-scramble output (during scramble generation) to stderr.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Oct 31, 2024
1 parent 25acb42 commit 8651fb5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl<TSemanticCoordinate: SemanticCoordinate<KPuzzle>> PhaseCoordinatePuzzle<TSe
// Note that this is safe to do at the end of this loop because we use BFS rather than DFS.
index_to_representative_pattern.push(representative_pattern);
}
println!(
eprintln!(
"PhaseLookupTable has size {}",
index_to_semantic_coordinate.len()
);
Expand Down Expand Up @@ -152,7 +152,7 @@ impl<TSemanticCoordinate: SemanticCoordinate<KPuzzle>> PhaseCoordinatePuzzle<TSe
move_application_table.push(table_row);
}

println!(
eprintln!(
"Built phase lookup table in: {:?}",
Instant::now() - start_time
);
Expand Down
2 changes: 1 addition & 1 deletion src/rs/_internal/search/search_logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl SearchLogger {
VerbosityLevel::Warning => false,
VerbosityLevel::Info => true,
} {
println!("{}", s)
eprintln!("{}", s)
}
}

Expand Down
14 changes: 7 additions & 7 deletions src/rs/scramble/puzzles/square1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ pub fn scramble_square1() -> Alg {
);
// for (i, solution) in phase1_search.enumerate() {
// if (i + 1) % (num_solutions / 10) == 0 {
// println!(
// eprintln!(
// "// Phase 1 solution #{}
// {}
// ",
Expand All @@ -226,7 +226,7 @@ pub fn scramble_square1() -> Alg {
// }
// last_solution = solution;
// }
// println!(
// eprintln!(
// "Elapsed time to find {} solutions for phase 1 test: {:?}
// ",
// num_solutions,
Expand All @@ -243,7 +243,7 @@ pub fn scramble_square1() -> Alg {
kpuzzle.default_pattern(),
);

println!("PHASE1ING");
eprintln!("PHASE1ING");

let start_time = Instant::now();
let mut num_phase2_starts = 0;
Expand Down Expand Up @@ -273,8 +273,8 @@ pub fn scramble_square1() -> Alg {
let phase2_start_pattern = scramble_pattern.apply_alg(&phase1_solution).unwrap();

num_phase2_starts += 1;
// println!("\n{}", phase1_solution);
// println!("\nSearching for a phase2 solution");
// eprintln!("\n{}", phase1_solution);
// eprintln!("\nSearching for a phase2 solution");
let phase2_start_time = Instant::now();
let phase2_solution = phase2_filtered_search
.search(
Expand All @@ -296,7 +296,7 @@ pub fn scramble_square1() -> Alg {

let cumulative_time = Instant::now() - start_time;
if num_phase2_starts % 100 == 0 {
println!(
eprintln!(
"\n{} phase 2 starts so far, {:?} in phase 1, {:?} in phase 2, {:?} in phase transition\n",
num_phase2_starts,
phase1_cumulative_time,
Expand Down Expand Up @@ -394,7 +394,7 @@ fn random_pattern() -> KPattern {
return scramble_pattern;
}

println!("discarding invalid scramble"); //<<<}
eprintln!("discarding invalid scramble"); //<<<}
}
}

Expand Down

0 comments on commit 8651fb5

Please sign in to comment.