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:
(With some other special rules that will be described later)
In this challenge, your task will be to calculate the value of sentences.
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 capital letter is worth 1.5 times it's corresponding lowercase letter
So, the word
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!