Skip to content

Commit

Permalink
feat: desc arrange "unique" scores system by scores and length
Browse files Browse the repository at this point in the history
  • Loading branch information
laresbernardo committed Aug 8, 2024
1 parent cb39dc8 commit b3de01e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/scrabble.R
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ scrabble_words <- function(tiles = "",
this <- lapply(words, function(x) sum(!!str_count(x, letters)))
done <- data.frame(word = words, scores = unlist(this)) %>%
mutate(length = str_length(.data$word)) %>%
arrange(desc(.data$scores))
arrange(desc(.data$scores), desc(.data$length))
} else {
done <- scrabble_score(words, scores.df)
}
Expand Down

0 comments on commit b3de01e

Please sign in to comment.