Skip to content

Commit

Permalink
fix: E direction & keep raw setup moves (#4)
Browse files Browse the repository at this point in the history
Closes #4.
  • Loading branch information
luckasRanarison committed Apr 25, 2024
1 parent c3091cc commit d2a748d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion three-style-lib/src/commutator/finder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ impl CommutatorFinder {
.current_moves
.is_empty()
.not()
.then_some(Alg::new(self.current_moves.clone()).reduce());
.then_some(Alg::new(self.current_moves.clone()));
let commutator = Commutator {
setup,
interchange,
Expand Down
16 changes: 8 additions & 8 deletions three-style-lib/src/moves/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ impl Move {

match (self.kind, self.count, rhs.kind, rhs.count) {
// wide move generators
(M::U, _, M::E, _) => Some(Move::new(M::Uw, count)),
(M::E, _, M::D, _) if is_inversed => Some(Move::new(M::Dw, count)),
(M::D, _, M::E, _) => Some(Move::new(M::Dw, count)),
(M::E, _, M::U, _) if is_inversed => Some(Move::new(M::Uw, count)),
(M::L, _, M::M, _) => Some(Move::new(M::Lw, count)),
(M::M, _, M::R, _) if is_inversed => Some(Move::new(M::Rw, count)),
(M::F, _, M::S, _) => Some(Move::new(M::Fw, count)),
Expand All @@ -185,19 +185,19 @@ impl Move {
(M::R, C::Simple, M::Rw, C::Prime) => Some(Move::new(M::M, C::Simple)),
(M::L, C::Prime, M::Lw, C::Simple) => Some(Move::new(M::M, C::Simple)),
(M::L, C::Simple, M::Lw, C::Prime) => Some(Move::new(M::M, C::Prime)),
(M::U, C::Prime, M::Uw, C::Simple) => Some(Move::new(M::E, C::Simple)),
(M::U, C::Simple, M::Uw, C::Prime) => Some(Move::new(M::E, C::Prime)),
(M::D, C::Prime, M::Dw, C::Simple) => Some(Move::new(M::E, C::Prime)),
(M::D, C::Simple, M::Dw, C::Prime) => Some(Move::new(M::E, C::Simple)),
(M::U, C::Prime, M::Uw, C::Simple) => Some(Move::new(M::E, C::Prime)),
(M::U, C::Simple, M::Uw, C::Prime) => Some(Move::new(M::E, C::Simple)),
(M::D, C::Prime, M::Dw, C::Simple) => Some(Move::new(M::E, C::Simple)),
(M::D, C::Simple, M::Dw, C::Prime) => Some(Move::new(M::E, C::Prime)),
(M::F, C::Prime, M::Fw, C::Simple) => Some(Move::new(M::S, C::Simple)),
(M::F, C::Simple, M::Fw, C::Prime) => Some(Move::new(M::S, C::Prime)),
(M::B, C::Prime, M::Bw, C::Simple) => Some(Move::new(M::S, C::Prime)),
(M::B, C::Simple, M::Bw, C::Prime) => Some(Move::new(M::S, C::Simple)),

(M::M, _, M::Lw, _) if is_inversed => Some(Move::new(M::L, count)),
(M::M, _, M::Rw, _) if self.count == rhs.count => Some(Move::new(M::R, count)),
(M::E, _, M::Uw, _) if is_inversed => Some(Move::new(M::U, count)),
(M::E, _, M::Dw, _) if self.count == rhs.count => Some(Move::new(M::D, count)),
(M::E, _, M::Dw, _) if is_inversed => Some(Move::new(M::D, count)),
(M::E, _, M::Uw, _) if self.count == rhs.count => Some(Move::new(M::U, count)),
(M::S, _, M::Fw, _) if is_inversed => Some(Move::new(M::F, count)),
(M::S, _, M::Bw, _) if self.count == rhs.count => Some(Move::new(M::B, count)),

Expand Down

0 comments on commit d2a748d

Please sign in to comment.