[Question]
  [
# Introduction
In Tennis, the server alternates serving on the left side or the right side of the court every point, starting on the right. It is possible to figure out which side to serve on for that point just based on the score; if there have been an even number of points you serve on the right, and after an odd number of points, on the left. Scoring in tennis works as follows:
```
Points | Corresponding Call
       |
0      | Love
1      | 15
2      | 30
3      | 40
```
Once a player scores 4 points, they win the game. If the score is tied at 40-40, the call is "Deuce" rather than "40-40" or "40 all". At Deuce, the subsequent point is called as "Advantage [x]" or "Ad [x]" where x is the player who scored. If the opposite player scores next, the score returns to Deuce, but if the same player scores again, they win.
# The Challenge
Your task is to write a function that takes the score and returns a truthy or falsey value. The input may be a string containing the call or a list containing the scores. Love, Deuce, and Ad must be strings but the rest of calls may be any numerical type as well. Deuce may be represented by singleton list containing "Deuce" or a list with "Deuce" and another value of your choice. You may choose which side corresponds to truthy and falsey, but **you must specify which corresponds to which side in your answer**. The scores will be separated by a hyphen, except in the case of Deuce wherein it will be simply "Deuce". For advantage, the score will be "Ad-40" or "40-Ad".
# Winning
This is code golf, so the score is the number of bytes in your function and the answer with the lowest score wins. [Standard loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) are forbidden.
# Test Cases
```
Love-Love | True
Love-15   | False
Love-30   | True
Love-40   | False
15-Love   | False
15-15     | True
15-30     | False
15-40     | True
30-Love   | True
30-15     | False
30-30     | True
30-40     | False
40-Love   | False
40-15     | True
40-30     | False
Deuce     | True
Ad-40     | False
40-Ad     | False
```
These test cases are exhaustive, i.e. that list represents every possible input and its corresponding output. I used True for right and False for left.
  
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 7 bytes
```
M`4|5
1
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7w3zfBpMaUy/D/f5/8slRdEMEFZhmaQmhjAwhtYsBlaAqRB9JAWSBpDBYDyhgbQGSANFAGSBqDxYAyJlAZE7CMCVjGJbU0OZXLMQUq75gCAA "Retina 0.8.2 – Try It Online") Link includes test cases. Outputs `0` for right and `1` for left. Explanation:
```
M`[45]
```
The number of 4s and 5s...
```
1
```
... must equal 1 if the serve is on the left.
[Answer]
# [Perl 5](https://www.perl.org/) (-p), ~~17~~, ~~11~~, 10 bytes
-6 using Neil's solution,
-1 thanks to Dom Hastings re-ordering
```
$_=1^y;45;
```
[Try it online!](https://tio.run/##bY4xC8IwEEZ3f8URMgmxV3qZYoaCODk6ikVsBqGY0lpB8Lcba6ptGlxueLzvcbVpKuk404wpftAM1gJ4wVSbwGqZJMrxQqfHhyKpnNvZuxGfA0/YN51ZeJBKgB5sT1X7JRl6MimEgZLKoTEjPjKOeuAbM4UwVDKcKj8wRoZNT7J4Q/MsYfwLYfQLYfzLxnRnEyp5@aeblyF52fp2sdfWifoN "Perl 5 – Try It Online")
0 for false, <>0 for true
[Answer]
# [Python 2](https://docs.python.org/2/), 26 bytes
Takes input in the same format as the test cases. Output is inverted, `1` for falsey cases and `0` for truthy ones. Normal output would be 1 byte longer with a `-` preprended.
```
lambda s:hash(s)*199%421%2
```
[Try it online!](https://tio.run/##Rc@xCoMwFIXh3ae4S4gWBWPioOAgdOwjdLFVUaiJmNtCoe@epqaJS/gv51uyvnFSsjBjczWPbrn1Heh66vQU6@TEqoqIgpHC4KBRQwP0ol5D9nto@j9YGZLnIcWerAzWppM2uB@d4nlQNp2ywf3olDiU8Ep4dR6e931q@4O3PY2iUW2AMEvYv1BHAOs2SwRKskrDB4imQCDGFKRCGGNMEvMF "Python 2 – Try It Online")
[Answer]
# [Haskell](https://www.haskell.org/), 29 bytes
```
odd.sum.map(mod 882.fromEnum)
```
[Try it online!](https://tio.run/##bY9fa8IwFMXf/RQXGdjC6qJWkLEOZH@etrfBHubA0NzWYJuUJBUHfvZ1N3XTWvYSkt8959yTDbdbLIomS1aNFmJs63Jc8iootYDFYjrOjC6fVF2GTcmlggSEHgDkKdxFkKN70MqhcpbY3qNgTebXNRRSoSVZCFewyiG6P/oACnQgKcbxLb5vZIEQ3CQjGIWQn@aa5jKDQBhdwZQS/OUsPnhxCEkCwzdT4xDcBhX4K2BhEZ45nW1YVRuyyGvQIb2jCHZoZPYFqTYGU0cV7S0NKiOVozVcCfjIfL2EOhy8U4f@V/vP5kXvMPIHcb9q0ILJnLYcfje2ZMZacpbErCOZzI8ZF6QNOZkItBkXkph1JTN2TvkDp5Cjh8is74kvY2PW7xKzXpeY9bs8Yp1iV7IU/@QuRZd8p1nBc9tEaVX9AA "Haskell – Try It Online")
An anonymous function taking a hyphenated call and returning `True` or `False`, just like in the test cases.
Note: it looks like we're taking values "mod 882", but actually in Haskell `mod 882` is the function \$y \mapsto (882 \bmod y)\$. (That is: it's a partially-applied `mod x y`.)
[Answer]
# [Haskell](https://www.haskell.org/), 28 bytes
```
f s=[1|c<-s,elem c"45"]==[1]
```
[Try it online!](https://tio.run/##bY9Ba8JAFITv/oohFDRgMNZ4KaYgLT21t0IPVjBsXuLimg3ZVSzktzd9G1uNoZdl93sz82a3idmRUk2TwcSraS0WgRmToj2EF829dcxw3ewTWSBGqgdALrAIkJN90oWlwhpmJ4dGm31Svm2gZEGGZT7u8JkjeDz7AEUWkmNssqOPrVSE0SQeYugjv8w1z2WGUVrpEvec4C5Xce3EPuIY3nt1IA92SwXcFaQM4SXhsw0rDxVb5Bja53cQ4EiVzL4gdFWRsFzRPPCgrGRheU1SpFhlXG8Sc4faObXvfnVaN6/6SIE7mLtVgxZM57yl/t3YklnYkqskCjuS6fyccUPakIuJQZtxI4nCrmQWXlP@wCXk7GEy63ui29go7HeJwl6XKOx3eaaDoK5kmf6Tu0y75FtkKslNE4iy/AE "Haskell – Try It Online")
Implement's [Neil's method](https://codegolf.stackexchange.com/a/214317/20260) of checking that the string has exactly one 4 or 5. [Test suite from Lynn](https://codegolf.stackexchange.com/a/214319/20260).
Haskell doesn't have a nice way to count elements satisfying a property. We could do `filter(`elem`"45")`, but then it seems too long to check the resulting list is a single element, or check that it's one of `"4"` or `"5"`.
We use a list comprehension to make a list with a `1` for each character that's in `"45"`, and check if we end up with the list `[1]`. Any value could be used in place of `1` here, including `s` itself.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 6 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
OP%25Ḃ
```
A monadic Link accepting a list of characters which yields `1` if serving from the right or `0` if serving from the left.
**[Try it online!](https://tio.run/##y0rNyan8/98/QNXI9OGOpv@H2x81rQGi//@jo9V98stSdUGEuo4ChGNsAGIamuoamkIZJmARYwO4OiATosrEAKrKJbU0OVU9VkchWt0xBaoBKOmYAmUYw4yAS6HYCTEEzDSBWQ9TAGTCdQPVxerEAgA "Jelly – Try It Online")**
### How?
```
OP%25Ḃ - Link: list of characters  e.g. "15-30"
O      - ordinals                       [49,53,45,51,48]
 P     - product                        286085520
   25  - twenty-five                    25
  %    - modulo                         20
     Ḃ - modulo-2                       0
```
---
Also 6 bytes using [Neil](https://codegolf.stackexchange.com/users/17602)'s [observation](https://codegolf.stackexchange.com/a/214317/53748) (inverted result):
```
f⁾45LḂ - Link: list of characters, S
 ⁾45   - list of characters = "45"
f      - filter (S) keep (those characters)
    L  - length -> 0, 1, or 2; but only 1 when serving from the left
     Ḃ - modulo-2
```
[Answer]
# [Raku](https://github.com/nxadm/rakudo-pkg), 12 bytes
```
{1-m:g/1|4/}
```
[Try it online!](https://tio.run/##bY5NC4JAEIbv/Yo5RPSB7CxOHQILITp1q2MXyTECzVAMJOuvb7aWrkuXgXl434f3xlm8UEkJowg8UA/pJMuzkBWJp8qDEl6JOO5nPBTgrWAdjfU/FROAKM0gvlw5V7v0zs7nQAWHrOCBBnIOUINtEOdf4qImXYTQiMh54@gRLWlLNdCOXoTQjLjYWX6glTSdmrh2h/paQnsLobWF0N6y4eLEZsQP/3j90CRv "Perl 6 – Try It Online")
An anonymous function that returns zero for left and non-zero for the right. This uses [Neil's observation](https://codegolf.stackexchange.com/a/214317/76162) that there must be exactly one `1` or `4` for it to be the left side's serve.
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 10 bytes
```
%%CSz287 2
```
[Try it online!](https://tio.run/##K6gsyfj/X1XVObjKyMJcwej/f5/8slRdQ1MA "Pyth – Try It Online")
### Explanation, A little different to the others here...
```
%%CSz287 2
   Sz        - Sort the input string, (so that Love-15 and 15-Love provide the same string)  
  CSz        - Get the 256 base int value of the string.
 % ^ 287     - Modulo that number by 287
%  ^     2   - Return whether that number is odd or even.
```
[Answer]
# [Scala](http://www.scala-lang.org/), ~~30~~ 29 bytes
```
_.matches("[^45]*[45][^45]*")
```
[Try it online!](https://tio.run/##TZBLq8IwEIX3@RVDVo0vLE03QoWKS125VO8lplMf1KSaKMLl/vY6RUuzOXM@@M5mnFaVauzhgtrDWp0N4MujKRzkdf3HnqqCcgYbfz@bI2RzWFhboTKQQfM7uSqvT@givv2R6X6wpfg0Lpp26Ujb4C3iK/vEcRt8xAA@GKcBJNMA5BfiNNgQdAuqSa90djINbILOppr0SmfL0Ja9LXt7iQ/9FfIiHOYFZ4I6AHOT0t5R6VPk4vY9Nf3JV6alIfCd53RKIiEEY//NGw "Scala – Try It Online")
My solution uses false for right and true for left.
* -1 Thanks to [Jo-King ♦](https://codegolf.stackexchange.com/users/76162/jo-king)!
[Answer]
# JavaScript (ES6), 26 bytes
Using [@Neil's method](https://codegolf.stackexchange.com/a/214317/58563) saves 4 more bytes.
Expects a string. Returns **0** for *left* or **1** for *right*.
```
s=>s.split(/4|5/).length%2
```
[Try it online!](https://tio.run/##hZBBCoMwEEX3PUUIFMxCMzbj0oLQZS8hGq0lJNJYV7172iqUCjHZzOrx5vHv9Vzb5jGMU6pNK11XOluebWZHNUwJx1fBWaak7qfb8eQao61RMlOmT7qEXs0s0@@hjBHOSX7wAXlBCVkB8AICfoDfgLBvyIu1IAQsBbsvPsBSEDIghAwCtg0@YNMAHkDEXmAwEiGyA0JkB4TIDhf5bGTIULXxyKr9B9wb "JavaScript (Node.js) – Try It Online")
---
# JavaScript (ES6), 30 bytes
Expects a pair of string scores (or a singleton for `Deuce`). Returns **0** for *right* or **1** for *left*.
```
a=>parseInt(a.join`2`,36)%31%2
```
[Try it online!](https://tio.run/##jZBfC4IwFEff@xRDEBRM79zqzSDoJegbRODQGYpsoubXX7KE/tDmnu7L4fwOt2ETG4q@7satkCVXVaZYduhYP/CzGAMWN7IWeZpHZB/6BPupKqQYZMvjVt6DKrh6FzlxL3qdWxiiJEF4Y4DwzkNogcAEEXhDRhMFm2neWYrWIF1kmdOQLlozUbCbZslvkwH6boL/EHGZoyvhFBz@RMHhTxQc/nTij4JrxGI6lq7hM/kJqSc "JavaScript (Node.js) – Try It Online")
---
# JavaScript (ES6), 34 bytes
Expects a string. Returns **0** for *left* or **1** for *right*.
```
s=>parseInt(s[0]+s[3]+s[5],35)%3%2
```
[Try it online!](https://tio.run/##hZDBCoMwEAXv/YogCIbWummSowWhl0L/QDyIxmKRRIz199OqUCrE5LKnYXZ4r3IqdTW0/RhLVQvTpEan174ctLjLMdI5FEed0/nw4kQ5Dml4MZWSWnXi3Kln1ETBQ00ink@AMUoSRA42gPAAoRUAK0DhB9gNDPYNhK8FLmAp2H3xBZYCl4GBy0Bh22ADNg1gAajvBXNGMvDswMCzAwPPDjfxroTLkNX@yKz@B8wH "JavaScript (Node.js) – Try It Online")
### How?
Looking at the 1st and the 4th characters provides enough information, except if the score is `Love-X` in which case we need to look at the 6th character as well. To make things easier, we just look at these 3 positions in all cases and hash them.
Below is a summary of the process for each possible input.
```
 input       | s[0]+s[3]+s[5] | parsed as base-35 | mod 3 | mod 2
-------------+----------------+-------------------+-------+-------
 "Love-Love" | "LeL"          |             26236 |   1   |   1
 "Love-15"   | "Le1"          |             26216 |   2   |   0
 "Love-30"   | "Le3"          |             26218 |   1   |   1
 "Love-40"   | "Le4"          |             26219 |   2   |   0
 "15-Love"   | "1Lv"          |              1991 |   2   |   0
 "15-15"     | "11undefined"  |  2906423713803553 |   1   |   1
 "15-30"     | "13undefined"  |  3064054991147303 |   2   |   0
 "15-40"     | "14undefined"  |  3142870629819178 |   1   |   1
 "30-Love"   | "3Lv"          |              4441 |   1   |   1
 "30-15"     | "31undefined"  |  8423518420834803 |   0   |   0
 "30-30"     | "33undefined"  |  8581149698178553 |   1   |   1
 "30-40"     | "34undefined"  |  8659965336850428 |   0   |   0
 "40-Love"   | "4Lv"          |              5666 |   2   |   0
 "40-15"     | "41undefined"  | 11182065774350428 |   1   |   1
 "40-30"     | "43undefined"  | 11339697051694176 |   0   |   0
 "Deuce"     | "Dcundefined"  | 36875963981381680 |   1   |   1
 "Ad-40"     | "A4undefined"  | 27969796811459804 |   2   |   0
 "40-Ad"     | "4Aundefined"  | 11891406522397304 |   2   |   0
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 7 bytes
```
Ṣ“Œọ‘ḥḂ
```
[Try it online!](https://tio.run/##y0rNyan8///hzkWPGuYcnfRwd@@jhhkPdyx9uKPpfzRQyCe/LBVOzdVBiBiaovKNDVD5JjA@SCGyfjAfrhvMM0ZRC9cJEkbWCebDdYJ5xihq4TpN0HSaoOg0QegEedEltTQZpDAWJOeYgmEOSGhurIL14XaVR01rFLyBROR/AA "Jelly – Try It Online") (the footer tests the program on all possible inputs)
Takes input in the form of a list of strings, e.g. `["Love","15"]`, `["40","Ad"]`, or `["Deuce"]`. Outputs 0 or 1, in the opposite sense from the table of test cases in the question (i.e. 0 = right, 1 = left).
This is using much the same idea as the other answers: we simply find a hash function that happens to map each possible input to the correct output. In order to make it more likely that a randomly selected hash function would produce the correct result (therefore reducing the number of bytes needed to specify which hash function we want), the input list is sorted before hashing it (thus almost halving the number of cases we need to match; a score of *X*-*Y* always produces the same answer as a score of *Y*-*X*).
There wasn't any skill that went into the selection of the hash function; there was a 2-12 probability that any given hash function would work, which is fairly high, so I simply tried Jelly's built-in hash functions in order from shortest to longest configuration, and picked the first one that worked. This is hash function [19,221]. Because configuring the hash function to output booleans would require a substantially larger configuration string, I just used the default output format (this one outputs numbers in the range 1…221) and took the least significant bit of the output as my output.
## Explanation
```
Ṣ“Œọ‘ḥḂ
Ṣ          Sort {the input list}
     ḥ     Hash {the sorted list}, with configuration
 “Œọ‘        [19, 221] (compressed representation)
      Ḃ    Take the least significant bit of the output
```
[Answer]
# [Bash](https://www.gnu.org/software/bash/), 20 bytes
```
[[ $[$1] = *[14]* ]]
```
[Try it online!](https://tio.run/##ZZBLC4JAFIX38ysOIvQAYcRx04MQylXQpp24mJobBqXiaNGvtyk1lTYD33z33AP3JHVSX6azaR1FsCPbjbHGPHJFPEcc1zPGyldOmko4Ae4yZ@yZXG@EgqSCU6AkXUKmegmVsQss@/NhMTonmYENFrCNtZjKUsJqhcnuEE7YPnuQ83lwLCpq0PUBhPKmW/a44V4L/tOu32QH/A234wa/2YEWvNce79IdtuFm2rA3nhbDZYKPuwUfdQs@7t5SdaZeB@pvW6AGbI5TvwE "Bash – Try It Online")
In Bash, any unset variables are 0 in `$[arithmetic mode]`.
A quick test revealed that if the input was evaluated in arithmetic mode, the following pattern emerges:
```
Result:  0  10 -10  15 -15  25 -25  30 -30  40 -40
  Side:  R   L   L   L   L   R   R   R   R   L   L
```
Thus, if the arithmetic result contains a 1 or a 4, it is a left serve, otherwise it is a right serve.
[Answer]
# [Husk](https://github.com/barbuz/Husk), 9 bytes
```
%2`%25Πmc
```
[Try it online!](https://tio.run/##yygtzv7/X9UoQdXI9NyC3OT////75Jel6oIIAA "Husk – Try It Online")
Same method as Jonathan Allan's answer.
[Answer]
## Batch, 32 bytes
```
@set/an=(%1)/10%%3^&1
@echo %n%
```
Takes input on the command line and outputs `1` for serves on the left and `0` for serves on the right. Explanation: Based on @GammaFunction's answer, by performing arithmetic evaluation on the input, and assuming that the variables `Love`, `Ad` and `Deuce` are unset and therefore zero, the tens digit of the result is `1` or `4` for serves on the left and `0`, `2` or `3` for serves on the right. This is then further reduced via modulo with `3` and bitwise and with `1` to produce the desired result.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 9 bytes
```
⁼¹ＬΦθ№45ι
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMO1sDQxp1jDUEfBJzUvvSRDwy0zpyS1SKNQR8E5vxSoQMnEVElHIVMTBKz//zcx0DU0/a9blgMA "Charcoal – Try It Online") Link is to verbose version of code. Output is a Charcoal boolean, where `-` (True) means you serve on the left and empty output (False) means you serve on the right. Explanation:
```
   Φθ       Filter input where
     №45ι   Literal string `45` contains character
  Ｌ         Length
⁼¹          Equals literal `1`
            Implicitly print
```
Longer than Retina, sigh... (I found several formulations for 9 bytes, but none shorter that weren't buggy.)
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 6 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
45S¢O≠
```
Port of [*@Neil*'s Retina answer](https://codegolf.stackexchange.com/a/214317/52210), so make sure to upvote him!!
[Try it online](https://tio.run/##yy9OTMpM/f/fxDT40CL/R50L/v/3yS9L1TU0BQA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfeV/E9PgQ4v8H3Uu@K/zP1rJJ78sVRdEKOlA2IamMJaxAYxlAmIZmsLUAVlgVUDaGCoDVmFsAFMBZIFVAGljqAxYhQlchQlUhQlUhUtqaTJI3DEFrtIxRSkWAA).
**Explanation:**
```
45S     # Push 45, and convert it to a list of digits: [4,5]
   ¢    # Count both of those in the (implicit) input-string
    O   # Take the sum of this pair of counts
     ≠  # And check that it's NOT equal to 1
        # (after which the result is output implicitly)
```
[Answer]
# [MathGolf](https://github.com/maxbergmark/mathgolf/blob/master/math_golf.txt), 7 [bytes](https://github.com/maxbergmark/mathgolf/blob/master/code_page.py)
```
▒$ε*N%¥
```
Port of [*@JonathanAllan*'s Jelly answer](https://codegolf.stackexchange.com/a/214313/52210), so make sure to upvote him!!
[Try it online.](https://tio.run/##y00syUjPz0n7///RtEkq57Zq@akeWvr/v5JPflmqLohQ4oKwDU1hLGMDGMsExDI0hakDssCqgLQxVAaswtgApgLIAqsA0sZQGbAKE7gKE6gKE6gKl9TSZJC4YwpcpWOKEgA)
**Explanation:**
```
▒        # Convert the (implicit) input-string to a list of characters
 $       # Convert each character to its codepoint integer
  ε*     # Take the product of this list (reduce by multiplication)
    N%   # Modulo-25
      ¥  # Modulo-2
         # (after which the entire stack joined together is output implicitly as result)
```
]