[Question]
  [
**[World Bowling scoring](https://en.wikipedia.org/wiki/Ten-pin_bowling#World_Bowling_scoring)**
Many people have gone to their local bowling center to play a few games of bowling, and many people continue to struggle to calculate their scores. World Bowling has introduced a simplified scoring system in order to attract more people to the sport. This scoring system is utilized in international games.
The scoring system works like this (from [Wikipedia](https://en.wikipedia.org/wiki/Ten-pin_bowling#World_Bowling_scoring)):
> 
> The World Bowling scoring system—described as "current frame scoring"[32]—awards pins as follows:
> 
> 
> * strike: 30 (regardless of ensuing rolls' results)
> * spare: 10 plus pinfall on first roll of the current frame
> * open: total pinfall for current frame
> 
> 
> 
If you're not familiar with ten-pin bowling, here's a recap.
There are 10 pins at the end of a bowling lane where the goal is to knock all of them down with a bowling ball. You get 2 rolls of a ball to attempt to knock them all down, preferably knocking them all down with the first roll (known as a **strike**). If you do get a strike, then that frame is completed and you do not need to roll the ball a second time. A strike is worth 30.
If you don't knock down all ten, you get one more roll. If you knock down all of the remaining pins, that is known as a **spare**. The score is worth 10 pins + the number of pins knocked down on the first roll. For example, if I knocked down 7 pins, then managed to knock down the remaining 3, that would be worth 17.
If after your second roll you fail to knock down all ten, that is known as an **open frame**. The score is worth the total number of pins knocked down for that frame.
There are **10 frames in a game**. If you're familiar with traditional bowling scoring, you don't get an extra roll in the 10th frame with the World Bowling Scoring. In traditional bowling scoring, it takes 12 consecutive strikes to get a perfect score of 300, whereas World Bowling scoring only requires 10 consecutive strikes.
## Challenge
Your challenge is to calculate the score given values from a score sheet.
On a score sheet, a **miss** is indicated by a dash (**-**), a **strike** with an **X**, and a **spare** with a slash (**/**). If these don't apply, then the pinfall count is simply indicated with a number (1-9). Fouls and splits are also recorded onto score sheets but you do not need to worry about these.
## Input
You will be given a string consisting of scores for each frame, and will have a total of ten frames. Each frame will have up to two values, or as little as 1 value if there was a strike. Your input may be string parameter to a function, read from a file, or from STDIN. 
For example, if I knocked down 1 pin on my first roll, then knocked down 2, the frame would look like "12". This does not mean 12 (twelve), but means 1 and 2, for a total of 3.
If I missed every pin with both rolls (gutter balls), it would look like this "--" (score of 0).
Each frame will be separated by a space.
## Sample input
```
-- 9- -9 X -/ 8/ 71 15 44 X
```
To break down this example,
* Frame 1 (--) - both rolls missed. scored 0
* Frame 2 (9-) - knocked down 9 on the first roll, missed on the second roll. Score 9
* Frame 3 (-9) - Missed all on the first, got 9 on the second. Score 9
* Frame 4 (X) - Strike, knocked down all ten. Score 30
* Frame 5 (-/) - Spare, missed all on the first, knocked down all with 2nd roll. Score 10 + 0 = 10
* Frame 6 (8/) - Spare, 8 pins on first roll, knocked down the other 2 with 2nd roll. Score 10+8 = 18
* Frame 7 (71) - open frame,7 pins on first roll, 1 pin on second roll. Score 7+1=8
* Frames 8,9,10 follow same examples as above.
## Output
Output will simply be a value that has the sum of the scores from all 10 frames. Using the sample input, the output will be 128. Your output may be a string or a numeric type. It may be a function return value, or written to STDOUT.
## Rules
* Assume that the input will always be valid. For example, an invalid frame would be "/8", "XX", "123", "0", etc.
* You do not need to worry about splits or fouls.
* Your code may be a full program or a function that takes in a string and returns the score.
* Your code must not throw any exceptions.
* This is code golf, the answer with the **fewest number of bytes wins.**
* Languages that use includes or imports must include the import statements as part of their code and count towards the byte count.
## Test Cases
```
"-- 9- -9 X -/ 8/ 71 15 44 X" -> 128
"-- -1 2- 12 22 5- 42 61 8- 72" -> 45
"X X X 1/ 2/ 3/ 4/ 5/ -- 9/" -> 174
"X X X X X X X X X X" -> 300
"-- -- -- -- -- -- -- -- -- --" -> 0
```
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~12~~ 11 bytes
### Code
```
S'/T:'X30:O
```
[Try it online!](https://tio.run/##MzBNTDJM/f8/WF0/xEo9wtjAyv///wgFEDTUVzDSVzDWVzDRVzDVV9DVVbDUBwA "05AB1E – Try It Online")
### Explanation
```
S             # Split the string into a list of characters
 '/T:         # Replace '/' with 10
     'X30:    # Replace 'X' with 30
          O   # Sum up the array (ignoring non-number elements)
```
[Answer]
# JavaScript, 43 bytes
```
f=([c,...s])=>c?({'/':10,X:30}[c]|c)+f(s):0
```
```
f=([c,...s])=>c?({'/':10,X:30}[c]|c)+f(s):0
```
```
Score(<input style="width:200px" oninput="o.value=f(this.value)" />) = <output id=o></output>
```
## How it works
We convert each character to its point:
* 'X' worth 30 point
* '/' worth 10 point
* '1' .. '9' worth 1 .. 9 point
* other characters worth 0 point
Then sum all points.
**Convert**
Bitwise *OR* operator `|` convert its operand to Int32 before operate. When converting to Int32, value first convert to Number (64bit float number) format, then trunk to Int32 (or converted to 0 if invalid).
* `ToInt32({'/':10,X:30}[c])` could be read as:
	+ if c == '/': result is 10;
	+ if c == 'X': result is 30;
	+ otherwise: result is `ToInt32(undefined)` -> `ToInt32(NaN)` -> 0;
* `ToInt32(c)` could be:
	+ if c == '1' ... '9': result is 1 .. 9;
	+ if c == ' ': `Number(c)` is 0, result is 0;
	+ otherwise: `Number(c)` is `NaN`, result is 0;
* Bitwise or here is same as "add", since one of its operand will be 0
**Sum**
* `[c,...s] = s` let `c = s[0]`, and `s = s.slice(1)`;
	+ if s is empty string, c is *undefined*;
	+ otherwise, c is first letter of s
* undefined is falsy, non-empty string (including space) is truthy
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 13 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
─*âⁿ┴8òt↨HÉ÷8
```
[Run and debug it](https://staxlang.xyz/#p=c42a83fcc1389574174890f638&i=%22--+9-+-9+X+-%2F+8%2F+71+15+44+X%22%0A%22--+-1+2-+12+22+5-+42+61+8-+72%22%0A%22X+X+X+1%2F+2%2F+3%2F+4%2F+5%2F+--+9%2F%22%0A%22X+X+X+X+X+X+X+X+X+X%22%0A%22--+--+--+--+--+--+--+--+--+--%22&m=2)
Unpacked, ungolfed, and commented it's thus.
```
F               for each character in input, execute...
 9R$'/20*+'X+   build the string "123456789////////////////////X"
 I              get the index of the current character in string
 ^+             increment and add to running total
                (index is -1 when no match; space and dash are 0 score)
```
[Run this one](https://staxlang.xyz/#c=F++++++++++++%09for+each+character+in+input,+execute...%0A+9R%24%27%2F20*%2B%27X%2B%09build+the+string+%22123456789%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FX%22%0A+I+++++++++++%09get+the+index+of+the+current+character+in+string%0A+%5E%2B++++++++++%09increment+and+add+to+running+total%0A+++++++++++++%09%28index+is+-1+when+no+match%3B+space+and+dash+are+0+score%29&i=%22--+9-+-9+X+-%2F+8%2F+71+15+44+X%22%0A%22--+-1+2-+12+22+5-+42+61+8-+72%22%0A%22X+X+X+1%2F+2%2F+3%2F+4%2F+5%2F+--+9%2F%22%0A%22X+X+X+X+X+X+X+X+X+X%22%0A%22--+--+--+--+--+--+--+--+--+--%22&m=2)
[Answer]
# [Python 2](https://docs.python.org/2/), 55 bytes
```
lambda l:sum(map(('123456789/'+'X'*20).rfind,l))+len(l)
```
[Try it online!](https://tio.run/##dc/BboMwDAbgM3mKX@xAstYLMUmBSt1zIG07UHVoSCFFQA97elZgm7TDbF8sffIv95/TxzXw3JxeZ19350sNfxxvnezqXsrEcGbdIS9KneySKnnkVD0NTRsue6/Uzr8H6dXchv424YSXmAglgUpUII1CIzcwDtaiivfAA@gZhguBaKFkwHTfwQxHsIyDQUHI@Y5Xa52I4gpLGw3WyDSshtNYkvRy8@dqbn/pn97Md600S1Ox5f878dtGU9FcB4xoA9YnjyLqhzZMaOSo5i8 "Python 2 – Try It Online")
Based off the string-index approach of many solutions.
[Answer]
# Java 8, ~~64~~ ~~59~~ 46 bytes
```
s->s.map(c->c<46?0:c<48?10:c>87?30:c-48).sum()
```
-5 bytes thanks to *@Neil*.  
-13 bytes thanks to *@OlivierGrégoire*.
**Explanation:**
[Try it online.](https://tio.run/##lY@9TsMwFIX3PsVRJ2e4NnbTNqWQzAx06VIJMRg3QELiRrFTCaE@e3BSFpBAVPdax/dHn49LfdRU7t96U2nncK8L@zEBCuvz9lmbHJuhHBswrAzbvPNFxZ1vc13zO@u34w0uWofFUzghnde@MNjA4ha9o9TxWjfMUGpu4kV2dR0kyWTQNFlms6AUJxF3Xc2ifn1mNN1TFRhfqOOh2KMO7lh4r7AvD486Ojvbvjuf1/zQed6Eia8ss9ywKRFWBFphBxJIBJYSco44xm7KzatuHYui0fSfDJJQBKmgFOaEWGEhkRCW6t@UHYaQAkpgJhALzAUGe@JCxLe46BO/5g/KaXLqPwE)
```
s->               // Method with an IntStream parameter and integer return-type
  s.map(c->       //  Loop over the characters
          c<46?   //   If the character is a space or '-':
           0      //    Count it as 0
          :c<48?  //   Else-if it's a '/':
           10     //    Count it as 10
          :c>87?  //   Else-if it's an 'X':
           30     //    Count it as 30
          :       //   Else (it's a digit):
           c-48   //    Count it as the value of the digit
       ).sum()    //   And sum everything
```
[Answer]
# F#, 106 103 bytes
```
let s c=Seq.sumBy(fun x->if x=' '||x='-'then 0 elif x='X'then 30 elif x='/'then 10 else int(string x))c
```
[Try it online!](https://tio.run/##dY5BS8NAEIXv/RUfBUlzGLe7TWwLTQ6Cd8FLQDyUsKkL7VaTraSQ/x6TRhAPMgMD3@O9eVUj5bm2fX@0gYYye7Gf983l9HhdVBdPK7mraLOIqOuGI1F4t54l9jjxYgKrX6ImokfSWJwPiybUzh9o47jsX3dPPtTX5/Mg5G@z8e1p7zz7@vBFxoyxgAu2ZiqA5HwM9lB55nduzq4berbEN8eMZd@LsBVkS4EoNoq1RqckCcWoicYI2mAMqZAYHjQbYW36gnG0wihWikSRKsY49SP9mVvYv/sN)
I think that this puzzle (without the golfing) would be a great question for a "Functional programming for beginners" guide. And I should know!
-3 from Kevin Cruijssen, for spotting that the whitespace between ' and "then" can be deleted. Thanks!
[recursive's Stax solution](https://codegolf.stackexchange.com/a/160264/78954) of using string indexes is very very good. If you port it to F# you can get it for **77 bytes**:
```
let s c=Seq.sumBy(fun x->"123456789/???????????????????X".IndexOf(char x)+1)c
```
[Try this online!](https://tio.run/##dY5BS8NAEIXv@RUfgUKDTNfdJk0CbQTBgycFLwHxEGJSA3arm1RS8L@vTfUi4ry5vZnvvbaXeu8a71@bgZ5689C8L/rD7vo4bw@WUYpQm2WcrNIsV1d/pwwXt/a5Ge/aef1SOcboQke1f1zf2MEd7/edHYqnYILvqs5Sue0HGwKmmG5oHN8xSMGbOx23lnDWhaw/T21GovNHwKX3IuSC5JSIIlOkGp0Qx5STJxojaIMxJEJsWGkyITW@ZJJWGMVSESsSxYRTP9YvnWH/7hc)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 17 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
ḟ⁾ -“X0/⁵”yV€o30S
```
A monadic link accepting a list of characters and returning an integer
**[Try it online!](https://tio.run/##AUIAvf9qZWxsef//4bif4oG@IC3igJxYMC/igbXigJ15VuKCrG8zMFP///8tLSA5LSAtOSBYIC0vIDgvIDcxIDE1IDQ0IFg "Jelly – Try It Online")**
### How?
```
ḟ⁾ -“X0/⁵”yV€o30S - Link: list of characters
 ⁾ -              - literal list of characters [' ','-']
ḟ                 - filter discard
    “X0/⁵”        - literal list of characters ['X','0','/','⁵']
          y       - translate (change 'X's to '0's and '/'s to '⁵'s)
           V€     - evaluate €ach character as Jelly code (the '⁵'s become 10s)
             o30  - logical OR with 30 (change all instances of 0 to 30)
                S - sum
```
---
Also at 17:
```
”/ẋ20ØD;;”XḊiÐ€⁸S
```
[Try that](https://tio.run/##y0rNyan8//9Rw1z9h7u6jQwOz3CxtgbyIh7u6Mo8POFR05pHjTuC////r6urYKmroGupEKGgq69goa9gbqhgaKpgYqIQAQA)
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 30 bytes
```
{TR'-/X '0㉈㉊'.univals.sum}
```
[Try it online!](https://tio.run/##dYw7CsJAFEVrXcUtxFHIy3NeJr/CTYjFdJLCgJCoZIgQxN64zSxkJAqihZzbncs575sq8XWHeYm1v243ithCrYb@PvQPFbbHw6WoXOja@uZd0aFczHZLlKdmOlFEyAmUw4IYGSPV0DGMgVXB25OGELRABDHBCBKNjJDK62ExohnCiBiGETPGLH/pHz7hv1OBfwI "Perl 6 – Try It Online")
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki/The-Language), 17 bytes
```
X
///
/
55
\d
*
_
```
[Try it online!](https://tio.run/##dYyxCsJAEAX7/YpphCAsj13vTPIF/sIVARW0sLEQ//80YmMhM93APK7P2/0cfTMcTr2ZJJPVasvFtnbs3Z3Z8ZmGi0mMQVRKodm7eZBOJJlUpyT7YHLGtMZKiBQ7UUQV607f9MNn9tcX "Retina – Try It Online")
I'm not quite up to date on the latest Retina changes. I'll be looking more into them when I get a chance and seeing if there's any new tricks for golfing this down. The code turns all strikes in to three spares, all spares into ten points, then all points to the corresponding number of underscores. Then it counts the number of underscores.
[Answer]
# [Perl 5](https://www.perl.org/) `-pF`, ~~30~~ 27 bytes
-3 bytes thanks to [Xcali](https://codegolf.stackexchange.com/users/72767/xcali)
```
#!/usr/bin/perl -pF
$\+=m%/%+3*/X/.0+$_ for@F}{
```
[Try it online!](https://tio.run/##K0gtyjH9/18lRts2V1VfVdtYSz9CX89AWyVeIS2/yMGttvr/f11dBUtdBV1LhQgFXX0FC30Fc0MFQ1MFExOFiH/5BSWZ@XnF/3UL3AA "Perl 5 – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 14 bytes
```
þ`I…/aXS¢ƶT*`O
```
[Try it online!](https://tio.run/##MzBNTDJM/f//8L4Ez0cNy/QTI4IPLTq2LUQrwf//fyVdXQVLXQVdS4UIBV19BQt9BXNDBUNTBRMThQglAA "05AB1E – Try It Online")
**Explanation**
```
þ`              # Push the digits of the input on the stack (removes everyting that isn't a digit)
  I…/aXS        # Push the input and the array "/","a","X" on the stack
        ¢       # Index of each element in the input ...
         ƶT*    # ... multiplied by its index (a could be anything that can't be found in the input), multiplied by 10.
            `O  # Sum the stack, implicit display
```
[Answer]
# [J](http://jsoftware.com/), 33 bytes
```
1#.31|('-123456789',20 1#'/X')i.]
```
[Try it online!](https://tio.run/##dY09CsJgEAV7TzGYYg1ks9nNF5MIVoKVlVUaKzGojRfw7lErf0DmvW5grtO8lJH1CqGgYvW8lmz2u@3kWVn7fSHqUadm2Xa9FFHhmdgg@aU8TPmM2el4vjEiqvSK9gyo0Rmt4w0pMcinpE4oHkTQKClYOp3SxlsbeOFGGLWRjMZ4BezX@eK783cyPQA "J – Try It Online")
## Explanation:
`]` the input
`('-123456789',20 1#'/X')` appends 20 `/` and one `X` to the string `-123456789`
`i.` finds the indices of the input in the above string
`31|` modulo 31 - to get rid of the spaces - they are not found in the string, so `i.` returns 31 for them
`1#.` finds the sum of the indices
[Answer]
# [Python 2](https://docs.python.org/2/), 67 bytes
-3 bytes thanks to @KevinCruijssen
```
lambda I,p='-123456789/'+20*'X':sum(p.rfind(i)for i in I if i in p)
```
[Try it online!](https://tio.run/##dY9Ba4NAEIXP7q942IPaZrruuBs1YO@B/ACh7SEhSBaazaLmkF9vstoWeui8OczAx3s8fxtPF8fTrvmYvvbnw3GP7co3CSkutFmXVS2TF86fkzbZDNdz6l/7zrpjarPu0sPCOmxhu@Xy2WSdv45o8B4ToSZQjRYkUUmUCspAa7TxCngCvUFxJRAFlBSYHj@YYQiasVaoCCU/4JnVRkRxiyAlwRKFhJYwEiFJBs8f11L/on@0MN8zo0WeiyX/340/FzQXofEQes4lNyLyvXUjdumQTXc "Python 2 – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 12 bytes
```
⁾/X,“½œ‘y|0S
```
[Try it online!](https://tio.run/##dYyxDcJAEMD6TOEBOB13fEgyB80zAA3KApEoAg0D0FAwAiUdggLEIPwiD0E0FMjuLHm5aNsu57S@ahyl/nC7PHap33er8Sw/z6f7Nm2O85xFaARpiIhSK5VhJSEQi3cTwwVz3CmF4EyNWqi8iAyY4spECUqpDDv9ph8@s7@@AA "Jelly – Try It Online")
## How it works
```
⁾/X,“½œ‘y|0S  Main link. Argument: s (string)
⁾/X,“½œ‘      Literal; yield [['/', 'X'], [10, 30]].
        y     Transliterate; replace '/' with 10, 'X' with 30.
         |0   Bitwise OR with 0. Bitwise operators attempt to cast to int, mapping 
              '0', ..., '9' to 0, ..., 9. All other characters map to 0.
           S  Take the sum.
```
[Answer]
# [Python 3.6](https://docs.python.org/3/), 54 bytes
```
lambda s:sum(map(f'123456789/{6**24}X'.find,s),len(s))
```
[Try it online!](https://tio.run/##dY69DoJAEIRreIoJDYdh3dxy/Ca@B4UNRi@SwEk8LYzx2VGotDAz1cyXyUyP2/nistlih/08dOPh2ME3/j6qsZuUjbVkJi/KquZnsdmIebXx1vbumPokHU5O@SSZ7eUKj95BhUFEhJpANVoQo2KUGjqHMWijNMQKkIYQtEAEOcEICo2KUMoHCaIWizRDGBnDMHLGsstf9Y/WfBn@6w@RNGEwXXt3U3a9/QY "Python 3 – Try It Online")
[Answer]
# [Kotlin](https://kotlinlang.org), 50 bytes
```
x->x.sumBy{"123456789/_${Math.E}_X".indexOf(it)+1}
```
[Try it online!](https://tio.run/##dZBBa4NAEIXv/orH4kFpxmU3GjVQD4Uceig59OItLG1NlphN0U2wyP52q5IeWtL3Zm4f83hzPNtam6G6GJyUNsFVNarZY9x2jVfbaLMP0XsYVevWbquAESEnUI4SxJFxpAIiQRyjZIuZ/NGEkoAkCAkpkRBiiZVARkjlX7jEZMEhOZYcMUfCMYXx@@Qv30v@d1gYVedmo94Ot2qTPseutjYB87UFFfD7KtA2dCycEec5z7uqGtU6uP2FimdjH/uho6KL2svp6atnQi7jZJVmOd/5/Yuyh2jjdiWLtHn/6LbzxQfhBjd8Aw "Kotlin – Try It Online")
Hopefully it's not against the rules to answer your own question but I wanted to join in on the fun.
`Math.E` produces the value `2.718281828459045`. I'm using it to create some filler string to push X to position 30. 
`indexOf` gets the position (0-based) of the character in the string "12345...". If it isn't found, it returns -1. We add 1 to make these 0, and that also makes the 0-based position the value of the string.
[Answer]
# PHP, ~~119~~ 109 bytes
-10 bytes thanks to *@KevinCruijssen*
```
<?foreach(explode(" ",$argv[1])as$f){[$a,$b]=str_split($f);$n+=$f==X?30:(int)$a+($b=='/'?10:(int)$b);}echo$n;
```
[Try it online!](https://tio.run/##NcjRCoIwFADQX7nIBTd0rJFRtoa/IYjEtJmCbMONCKJfb/XSeTx@9ildmsltRo8zMU@/upshGWQl6u3@6ERPdcCJvjrUJQ69CnG7Br8ukfxWoi0UTkq1zX53JouNFHVBcFAq53kj/jdQ@Tbj7NDKlBJjUDNgNbTAOJw4HAWIA1QVtB/n4@JsSMx@AQ)
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 23 bytes
```
ＩΣＥχΣＥＳ⎇№-/Xλ×χ⌕-//XλＩλ
```
[Try it online!](https://tio.run/##NYxBCsIwFESvMnT1hX5ioKLFZUFwIQh1kW2oRQNpWtJE8PQxrTqrB29muqf23ahtSldvXKBGz4HaONBFTyS3Jf58dlMMbcilB21K3HrvtH9TM8a8KlioooRdhBn6eV2ejLsv5qeyW88zfXNMiRk1g2sosMBBYC8hd6gqqMQv@wE "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
  Ｅχ                    Map over 10 frames
      Ｓ                 Input the frame
     Ｅ                  Map over the characters
            λ           Current character
        №-/X            Search the literal string `-/X`
                    λ   Current character
               ⌕-//X    Find position in literal string `-//X`
             ×χ         Multiply by predefined variable 10
                      λ Current character
                     Ｉ  Cast to integer
       ⎇                Ternary
    Σ                   Sum for each frame
 Σ                      Sum over frames
Ｉ                       Cast to string for implicit print
```
[Answer]
# [Red](http://www.red-lang.org), 93 bytes
```
func[b][s: 0
foreach c trim/all b[s: s - 1 + index? find{-123456789/...................X}c]s]
```
[Try it online!](https://tio.run/##dY3LCoJQFEXnfsXCaZxO93ZNbdI/NBLEQamXBLPQgiD6dstZD9p7wxmcBauvq3FbV@RF4Nejv3Zlvi/yYc0i8Ke@3pUHSi59c9Rd27KfPgOCYUbTVfVtg3/duxi7dNEqTlKd/yZ7lMVQjAHBuW@6C55QhFSQlAxREiU2mAjnyMIPSgz25bNYSyQ4y8qQCLF94zKmGsUqS8UpkTIp9Af66Jfq78LxCQ "Red – Try It Online")
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), 40 + 18 = 58 bytes
```
using System.Linq;
s=>s.Sum(c=>c>87?30:c<46?0:c<48?10:c-48)
```
[Try it online!](https://tio.run/##lY9BS8NAEIXv@RWPnhJwsu5206S2SQ4FT3rqwYJ4CGtaFtoNZjaCSH97TFoRFIT2vYG5vPl4Y5hM09Z9x9btsP5gXx/iB@veFkFg9hUzVsFngEHsK28N3hv7isfKupB9O9w8v6BqdxydMufkqG/SfefM8hy8gXW@wDbvOS84XneH0OSFKbK0nN7emaWelaeVlXLYpLOoHzr84a0ax82@jp9a6@uhZh1uwwkR5gSaYwMSyARSCZlAa2wmUbS4lEESiiAVlEJC0AoziYyQqospG4yWAkpgKqAFEoGxnrgS8ctXPfHv/FCOwbH/Ag "C# (.NET Core) – Try It Online")
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), 53 bytes
```
Write(ReadLine().Sum(c=>c>87?30:c<46?0:c<48?10:c-48))
```
[Try it online!](https://tio.run/##Sy7WTS7O/P8/vCizJFUjKDUxxSczL1VDUy@4NFcj2dYu2c7C3N7YwCrZxsTMHkxZ2BsCaV0TC03N//91dRUsdRV0LRUiFHT1FSz0FcwNFQxNFUxMFCIA "C# (Visual C# Interactive Compiler) – Try It Online")
[Answer]
# [SNOBOL4 (CSNOBOL4)](http://www.snobol4.org/csnobol4/), ~~169~~ ~~151~~ 147 bytes
```
	F =INPUT ' '
R	F '-' =0	:S(R)
T	F 'X' ='_'	:S(T)
S	F LEN(1) . X ARB . Y ' ' REM . F	:F(O)
	X '_' =30
	Y '/' =10
	S =S + X + Y	:(S)
O	OUTPUT =S
END
```
[Try it online!](https://tio.run/##FY7BCsIwEETP2a@YWxJKbIMVbSEHxRYEbSVJIT0JnsUe/H/i5rSzb/fB/L7be/u0OYsR7jY9lwgJSZ5XaSRcI/qgvKZYQGIgX7KgqCkwug@Tsho7JJz9hedadPjhwXkU/ahmTSKBLbh9Q4LvNUfLMcAFVGxWWEWvgqZZzEssFVygYbrmbAw6A9Pxk6lxqnG0sAe0LdIf "SNOBOL4 (CSNOBOL4) – Try It Online")
```
	F =INPUT ' '					;* read input and append a space
R	F '-' =0	:S(R)				;* replace - with 0
T	F 'X' ='_'	:S(T)				;* replace X with _
S	F LEN(1) . X ARB . Y ' ' REM . F	:F(O)	;* set first character to x, remainder up to ' ' to y, and remainder to F
	X '_' =20					;* replace _ in x with 20
	Y '/' =10					;* replace / in y with 10
	S =S + X + Y	:(S)				;* else X and Y are their values so we can sum them
O	OUTPUT =S					;* output the sum
END
```
[Answer]
# [Clojure](https://clojure.org/), 70 bytes
```
#(reduce(fn[s i](+ s(case i\- 0\/ 10\X 30\space 0(bigint(str i)))))0%)
```
[Try it online!](https://tio.run/##FctBCsIwEAXQq3wqwgQZkmBFe5OAcVHjKCMllqQ9f2zf/qXp912LNJqL5mXKoHagIq81Cb3zvUIfdEKlNFaBRoaLFt7FgLOLdR6TwNFTP1umuhSo2bmjaR0zBgYPCGCLm8XVw1/Q9widMe0P "Clojure – Try It Online")
When `reduce`ing over a String, each char is actually converted into a char - who would have thought. But this meany, I have to write `\space` and that hurts more than one can imagine. Also, when creating an actual number from a char, the combination of `bigint` and `str` seems to be the only usable combination.
Well, aside from all these struggles: Anonymous function that returns the score as a natural.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 38 bytes
```
->s{s.tr("/X -",":N00").sum-s.size*48}
```
[Try it online!](https://tio.run/##dY/BbsIwEETv@YqRubQom42NQ0Kl8Ak9R6p6AGRaDiDEJhKt8benjltV7QHNnmbf7mguw/Zj3LcjrcVL0V8eFHcglaun57JUj4UMR5JCDp9ubpsw9k56QQufAYoIKwKtEC8YDaPW0BWsRafQrqFNk/9wpGEoGjAGFcEaLDUaQm0SaasEdpikGYaxYFhGxZhS@Ptfbf9g/5T2i7L8zbs7iYxcyFKXwm127/A3yd0N5yGWUzMvYYJmfv8iryGHu57drj@c3qLlggrZ@AU "Ruby – Try It Online")
[Answer]
# [Husk](https://github.com/barbuz/Husk), 17 bytes
```
+ṁi¹*10+#'/¹*3#'X
```
[Try it online!](https://tio.run/##dYwxCsJQEAWvMiRFwGRZd/NjknPYfBB7RcRCxDq5VVpvohf5JiCChcwrHgzM4XY9pfPlvq1e45DK5zQcH9PK1mVe6HzqvIgppV0mQi9IT0SUTmkNawiBmFWLFcMFc9xphOBsjE5offaRBVNcqZWgNMqS1K/84ZP8u2z/Bg "Husk – Try It Online") This function takes the sum of all digit characters in the string, plus 10 times the number of `/` characters, plus 30 times the number of `X` characters.
]