Sha256: 7c58c50aba4c19f7389d856273962ba75e807b472be3b51f00ead8c11615f7b8
Contents?: true
Size: 562 Bytes
Versions: 40
Compression:
Stored size: 562 Bytes
Contents
scrabbleScore <- function(input){ # Letter Value # A, E, I, O, U, L, N, R, S, T 1 # D, G 2 # B, C, M, P 3 # F, H, V, W, Y 4 # K 5 # J, X 8 # Q, Z 10 letterScore <- c(1,3,3,2,1,4,2,4,1,8,5,1,3,1,1,3,10,1,1,1,1,4,4,8,4,10) names(letterScore) <- LETTERS chars <- unlist(strsplit(input, "")) sum(letterScore[toupper(chars)]) }
Version data entries
40 entries across 40 versions & 1 rubygems