Learn R Programming

ScrabbleScore (version 1.0)

sws: Scrabble Word Score

Description

Gives the base word score for a string in scrabble.

Usage

sws(w,only.possible=TRUE,check.valid=FALSE)

Arguments

w
Word or vector of words
only.possible
Default=TRUE Only consider scores that are possible based on the distribution of scrabble letters. For example "zzz" would score 30 if it weren't for the fact that there is only 1 'z' necessitating the use of 2 blanks, for a real score of 10.
check.valid
Default=FALSE When TRUE returns a score of 0 for words not in the TWL06 dictionary.

Value

Returns a vector of values for the word score of each word passed in.

See Also

sls

Examples

Run this code
sws("zzz")
sws(c("dog","zzz"))
sws(c("dog","zzz"),only.possible=FALSE)
sws(c("dog","zzzzzz"),only.possible=FALSE,check.valid=TRUE)

Run the code above in your browser using DataLab