R/sws.R

sws <-
function(w,only.possible=TRUE,check.valid=FALSE){
  #Scrabble words have no case
  w <- tolower(w)
  wv <- strsplit(w,"")
  init.score <- sapply(lapply(wv,sls),sum)
  if(only.possible){
    init.score <- init.score - impossible.points(wv)
  }
  if(check.valid){
    init.score[!is.twl06.word(w)] <- 0
  }
  return(init.score)
}

Try the ScrabbleScore package in your browser

Any scripts or data that you put into this service are public.

ScrabbleScore documentation built on May 2, 2019, 2:01 p.m.