Skip to content

Commit

Permalink
Merge pull request #21 from inthar-raven/booth
Browse files Browse the repository at this point in the history
chirality should use booth
  • Loading branch information
inthar-raven authored Aug 12, 2024
2 parents 1393655 + 765f81a commit ffac05e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/words.rs
Original file line number Diff line number Diff line change
Expand Up @@ -663,14 +663,12 @@ where

/// The chirality of a scale word.
pub fn chirality(word: &[Letter]) -> Chirality {
let mut modes = rotations(word);
modes.sort_unstable();
let least_mode_word = least_mode(word);

let word_rev: Vec<usize> = word.iter().cloned().rev().collect();
let mut modes_rev = rotations(&word_rev);
modes_rev.sort_unstable();
let least_mode_word_rev = least_mode(&word_rev);

match modes[0].cmp(&modes_rev[0]) {
match least_mode_word.cmp(&least_mode_word_rev) {
Ordering::Less => Chirality::Right,
Ordering::Equal => Chirality::Achiral,
Ordering::Greater => Chirality::Left,
Expand Down

0 comments on commit ffac05e

Please sign in to comment.