Skip to content

Commit e90a585

Browse files
committed
Update Readme
Fix rotate bug
1 parent ca951b0 commit e90a585

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

rubiks/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,9 @@ cargo run
2828
需要安装trunk `cargo install --locked trunk`
2929

3030
然后运行 `trunk serve`, 打开http://127.0.0.1:8080
31+
32+
## References
33+
34+
- https://ruwix.com/
35+
- https://worldcubeassociation.org/regulations/#article-12-notation
36+
- https://www.jaapsch.net/puzzles/thistle.htm

rubiks/src/viewer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ fn generate_command(
466466
} else if piece_translation.x.round() == 0.0 {
467467
return Move::M(rotate);
468468
} else {
469-
return Move::R(rotate);
469+
return Move::R(rotate.inverse());
470470
}
471471
}
472472
} else {
@@ -521,7 +521,7 @@ fn solve_puzzle(
521521
let solution = solve(&cube_setting.cube);
522522
if let Some(s) = solution {
523523
if cube_setting.cube.apply_moves(&s).is_solved() {
524-
println!("solved");
524+
info!("solved in {} step", s.len());
525525
for command in s {
526526
move_seq.push_back(command);
527527
}

0 commit comments

Comments
 (0)