class ScrabbleScore {
static scoreWord(String word) {
int total = 0
String words = word.toUpperCase()
for(char letter in words){
switch(letter){
case "A":
case "E":
case "I":
case "O":
case "U":
case "L":
case "N":
case "R":
case "S":
case "T" :
total +=1
break
case "D":
case "G" :
total +=2
break
case "B":
case "C" :
case "M":
case "P" :
total +=3
break
case "F":
case "H" :
case "V":
case "W":
case "Y":
total +=4
break
case "K":
total +=5
break
case "J":
case "X" :
total +=8
break
case "Q":
case "Z":
total +=10
break
}
}
return total;
}
}
Thank you, friend!
I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
please click it!
(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)
The weight is reduced because of the lack of Voting Power. If you vote for me as a witness, you can get my little vote.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit