Introduction
In the land of [Insert cool name here], people don't buy things with money, because everyone has a severe allergy to paper. They pay eachother with words! But how is that? Well, they give each letter number values:
a=1,b=2,c=3,etc.
(With some other special rules that will be described later)
In this challenge, your task will be to calculate the value of sentences.
Challenge
You will take an input which will be a sentence. You may assume the input has no newlines or trailing spaces. The challenge will be to calculate the value of the sentence, using these rules:
a=1,b=2,c=3,etc.
- A capital letter is worth 1.5 times it's corresponding lowercase letter
H=h*1.5
So, the word
cab
Would be worth c+a+b = 3+1+2 = 6
But the word Cab
with a capital c would be worth (c*1.5)+a+b = 4.5+1+2 = 7.5
So if your program input was "Cab" your program would output 7.5
- All non alphabetic characters are worth 1.
This is code golf, so shortest answer in bytes wins. Good luck!
7.0
instead of7
? \$\endgroup\$