Skip to content

Commit

Permalink
fix: exclude_here accepts upper case too
Browse files Browse the repository at this point in the history
  • Loading branch information
laresbernardo committed Jul 18, 2024
1 parent 21a2906 commit 2570bd8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/scrabble.R
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ scrabble_words <- function(tiles = "",
# Exclude these tiles
force_not <- unique(tolower(unlist(strsplit(force_exclude, ""))))

message("Tiles: ", v2t(tiles))
message("Tiles: ", v2t(toupper(tiles)))

### WORDS

Expand All @@ -322,7 +322,7 @@ scrabble_words <- function(tiles = "",
unique_new != length(words), sprintf("(%s new)", unique_new), ""
)))
}
words <- dictionary
words <- tolower(dictionary)
# Words can't have more letters than inputs
words <- words[nchar(words) <= ntiles]
.temp_print(length(words))
Expand Down Expand Up @@ -350,7 +350,7 @@ scrabble_words <- function(tiles = "",
}
}
# Exclude letters from positions (Wordle)
pos_tiles <- str_split_merge(exclude_here)
pos_tiles <- str_split_merge(tolower(exclude_here))
for (i in seq_along(pos_tiles)) {
these <- str_split(pos_tiles, "\\|")[i][[1]]
if (!any(these %in% letters)) next
Expand Down

0 comments on commit 2570bd8

Please sign in to comment.