Introduction
OnePlus is a Chinese smartphone manufacturer founded in December 2013. Their latest phone, OnePlus 5, was unveiled on June 20, 2017.
I am sure you have seen that the name of the phone can easily be translated to a sum.
OnePlus
can be written like 1+
thus OnePlus 2 = (1+ 2) = 3
Input
The name of one OnePlus phone. The above list in the only possible input
OnePlus 1
OnePlus 2
OnePlus X
OnePlus 3
OnePlus 3T
OnePlus 5
Output
The sum of the name (a number not a string)
OnePlus 1 => 2
OnePlus 2 => 3
OnePlus X => an integer
OnePlus 3 => 4
OnePlus 3T => 27 (T = Today = 23 thus 1+3+23=27)
OnePlus 5 => 6
Rules
The input can be written in different versions. This applies to every names. For example
OnePlus 1
OnePlus1
One+ 1
One+1
1+ 1
1+1
- The output for
OnePlus X
is an integer that should be different from the other phones names. Whatever you want except2,3,4,27,6
- The
T
inOnePlus 3T
will always be23
which is the day I am posting this. - This is code-golf, so the shortest solution (in bytes) wins.
One
case-sensitive? What about inputs likeOne + 1
(arbitrary number of spaces between the tokens)? \$\endgroup\$ – officialaimm Jun 23 '17 at 7:46One
andPlus
are case-sensitive. You only have to rely to the provided format \$\endgroup\$ – Weedoze Jun 23 '17 at 8:28