[Question]
  [
The challenge is to golf a program when given a string composed of any number of asterisks, then a comma, than any number of asterisks, say which side has more.
The asterisk-strings can be empty.
# Output
`0` for ties.
`1` for the left.
`2` for the right.
# Examples
Input: `***,****` Output: `2`
Input: `***,` Output: `1`
Input: `***,***` Output: `0`
Input: `,` Output: `0`
# Scoring
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"). Shortest answer wins.
  
[Answer]
# [Python 2](https://docs.python.org/2/), 25 bytes
```
lambda s:cmp(s[::-1],s)%3
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUaHYKjm3QKM42spK1zBWp1hT1fh/Wn6RQo5CZp5CUWJeeqqGqaYVlwJIrAhNTCGxuDi1qEQhTUNdS11BC6hHW0FdRx1EgvlFmgq2tgrRBjoKhjoKRrHRIItydIDCsf8B "Python 2 – Try It Online")
[Answer]
# [///](https://esolangs.org/wiki////), ~~60~~ ~~64~~ 28 bytes
```
/*,*/,//,*/2//*,/1//,/0//*//
```
[Try it online!](https://tio.run/##K85JLM5ILf7/X19LR0tfR18fSBrpAzn6hkC2vgGQqa//X0sLKAsC/wE "/// – Try It Online")
Found out most of my program was unnecessary, -32 bytes.
I made this program when I was learning the language, and decided to post it as a question.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 6 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
Â.S(3%
```
**[Try it online!](https://tio.run/##yy9OTMpM/f//cJNesIax6v//WlpaOkAMAA "05AB1E – Try It Online")**
### How?
Note that `','` is greater than `'*'`.
```
Â.S(3%
Â      - input, reversed(input) (say a, b)
 .S    - compare: 1 if a > b; -1 if a < b; 0 if a = b
   (   - negate
    3  - push three
     % - modulo
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~65~~ \$\cdots\$ ~~54~~ 47 bytes
Saved a 10 bytes thanks to [dingledooper](https://codegolf.stackexchange.com/users/88546/dingledooper)!!!  
Saved a byte thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat)!!!  
Saved 7 bytes thank to [l4m2](https://codegolf.stackexchange.com/users/76323/l4m2)!!! 
```
f(c){c=strlen(c)-strspn(c,"*")*2;c=c>1?2:c!=1;}
```
[Try it online!](https://tio.run/##TVDBbsMgDL33KzxLlYASLcm0Q8foDtO@osmhomRL1KUR5IAW5dszF5GtSIZn/J4fxmSfxixLwwyfjPaju9iecEbID4QkCuSiVEabQ/FWvpgHXah5@T61PeMwbYCW@To5Ae5Yg4YJq/BRVmH/TvGMEu7zJ5zVnWK0fvRJJYSQFALJUMi4xwu84aRq@xFsGGwY7TnKYCplIXOZJ0JzdcBurI6KuaLjFXz7Y68Ni178MWXRnyvY7bp1iNUgkDTRj13N1V9xcFRuGFa49RVCdoDtGQj2NORKlxAkfQT10P8v7eq1zbyZl18 "C (gcc) – Try It Online")
[Answer]
# Gema, 20 characters
```
*,*=@cmps{*;*;2;0;1}
```
Sample run:
```
bash-5.0$ echo -n '***,****' | gema '*,*=@cmps{*;*;2;0;1}'
2
```
[Try it online!](https://tio.run/##S0/NTfz/X0tHy9YhObeguFrLWsvayNrA2rAWKKoFFAcCAA "Gema – Try It Online") / [Try all test cases online!](https://tio.run/##lZA9T8MwEIbn@FccVui1VqN8rJaldmBgQmINEUodl1ZtE8t2JaTQ3x7sBEoHGBh89/ruPd1jb2q7Gxolj7VRkKzBKeteZW2VmJOoRMbY0h@GlcACvyvhluNNPxSysbD8kgtCtNm3bgv4AfdJnln4JRc@vrQI@Njqs/P5WdnzMYiHd62kU42XTwckZNsZ2AeTj0Dj/u4KWq6qC@XQdCQy47Sg8RyU3HWQBOs4Rf22tNMufVOnOrVGjgJw8PhiJU/a9owzXvCM55cBYUEJif7xgOsaGk8QQfU/jFPbg0KAK8sbnxB/WasKZrPpJeETAlTTtWr4BA "Bash – Try It Online")
[Answer]
# [Bash](https://www.gnu.org/software/bash/) + Standard utilities, 28 bytes
```
dc<<<1`tr *, 1d`1-dd*v/3+3%p
```
[Try it online!](https://tio.run/##S0oszvj/PyXZxsbGMKGkSEFLR8EwJcFQNyVFq0zfWNtYteD/fy0tLR0g1gIA "Bash – Try It Online")
[Answer]
# [sed](https://www.gnu.org/software/sed/) -E, 30 bytes
```
s/(.*),\1/0/;s/.+0/1/;s/0.+/2/
```
[Try it online!](https://tio.run/##K05N0U3PK/3/v1hfQ09LUyfGUN9A37pYX0/bQN8QxDDQ09Y30v//XwsEdID4X35BSWZ@XvF/XVcA "sed – Try It Online")
[Answer]
# [K (ngn/k)](https://bitbucket.org/ngn/k), ~~17~~ 16 bytes
**Solution:**
```
{2/c<|c:#'","\x}
```
[Try it online!](https://tio.run/##y9bNS8/7n2ZVbaSfbFOTbKWsrqSjFFNR@z9NXUNJS0tLB4i1lKzBTCgFFjBUBqrT/P8fAA "K (ngn/k) – Try It Online")
**Explanation:**
```
{2/c<|c:#'","\x} / the solution               -> e.g. 1         e.g. 2     e.g. 3
{             x} / lambda taking implicit 'x' -> "***,****"     "***,"     "***,***"
          ","\   / split string on comma      -> ("***";"****") ("***";"") ("***";"***")
        #'       / count length of each       -> 3 4            3 0        3 3
      c:         / store as c                 -> 3 4 (noop)     3 0        3 3
     |           / reverse it                 -> 4 3            0 3        3 3
   c<            / is c less than this?       -> 1 0            0 1        0 0
 2/              / convert from base 2        -> 2              1          0
```
**Extra:**
* **13 bytes** if it doesn't need to be a function `2/c<|c:#'","\`
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~7~~ 6 bytes
```
,ṚMḄ2c
```
A monadic Link accepting a list of characters which yields an integer in \$[0,2]\$.
**[Try it online!](https://tio.run/##y0rNyan8/1/n4c5Zvg93tBgl////X11LS0sHiNUB "Jelly – Try It Online")**
### How?
Note that `','` is greater than `'*'`.
```
,ṚMḄ2c - Main Link: s                     e.g.:  "*,"          ",*"          ","
 Ṛ     - reverse (s)                             ",*"          "*,"          ","
,      - pair (s) with (that)                    ["*,",",*"]   [",*","*,"]   [",",","]
  M    - indices of maximal values               [2]           [1]           [1,2]
   Ḅ   - convert from base 2, say x              2             1             4
    2  - two                                     2             2             2
     c - (2) choose (x) - i.e. binomial(2,x)     1             2             0
       - implicit print (a list with a single element prints the element)
```
[Answer]
# [Perl 5](https://www.perl.org/) + `-pl`, 21 bytes
```
/,/;$_=$`cmp$';s;-1;2
```
[Try it online!](https://tio.run/##K0gtyjH9/19fR99aJd5WJSE5t0BF3brYWtfQ2uj/fy0tLR0g1uICMbigPC6df/kFJZn5ecX/dQtyAA "Perl 5 – Try It Online")
[Answer]
# [APL (Dyalog Extended)](https://github.com/abrudz/dyalog-apl-extended), 9 bytes
```
(⊥⍋|⍒)⊢⍮⌽
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn/X@NR19JHvd01j3onaT7qWvSod92jnr3/0xQetU1QeNTb96ir@dB640dtEx/1TQ0OcgaSIR6ewUB5dS0tLR0g1lLngnLgDKigjrqOOgA "APL (Dyalog Extended) – Try It Online")
### How it works
```
(⊥⍋|⍒)⊢⍮⌽  ⍝ left '*,' | right ',*' | equal ','
      ⊢⍮⌽  ⍝ Length-2 nested vector of self and reverse
  ⍋        ⍝ Grade up; order of indices to make it ascending-sorted
           ⍝ 1 2       | 2 1        | 1 2
    ⍒      ⍝ Grade down; order of indices to make it descending-sorted
           ⍝ 2 1       | 1 2        | 1 2
   |       ⍝ Right modulo left
           ⍝ 0 1       | 1 0        | 0 0
 ⊥         ⍝ From base 2 to integer
           ⍝ 1         | 2          | 0
```
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), ~~20~~ ~~19~~ 13 bytes[SBCS](https://en.wikipedia.org/wiki/SBCS)
Whooping -6 thanks to @Bubbler.
```
(⊃3|⍒-⍋)⊂,⊂∘⌽
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///qG9qZr7Co7YJCgZc1cY1Gnb6jzpmPOqdpAtldGs@6t2q8ahnL5DSrAUpedTVrAFSgCmnAZQCymOTQ5WqRpb7j6atq0kHiEGW9@z9nwZ22qPePqCaQ@uNH7VNBDo4OMgZSIZ4eAYD5dW1tLR0gFhLnQvKgTOggjrqOuoA "APL (Dyalog Unicode) – Try It Online") This should be golfable as there are some things I am repeating there but I am not sure how to do it yet.
## [APL (Dyalog Unicode)](https://www.dyalog.com/), 19 bytes[SBCS](https://en.wikipedia.org/wiki/SBCS)
```
{3|×1+(2×⍵⍳',')-≢⍵}
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///qG9qZr7Co7YJCgb/q41rDk831NYwOjz9Ue/WR72b1XXUNXUfdS4C8mr/p4FVPerte9TV/Kh3zaPeLYfWGz9qmwg0ITjIGUiGeHgGA1Wpa2lp6QCxljoXlANnQAV1gOYCAA "APL (Dyalog Unicode) – Try It Online")
[Answer]
# JavaScript (ES6), ~~26~~ 25 bytes
*Saved 1 byte thanks to @tsh*
Taking advantage of the looser output rules: this versions returns `0` for ties, `undefined` for left or `*` for right.
```
s=>(s+0)[s.search`,`*2+1]
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@7/Y1k6jWNtAM7pYrzg1sSg5I0EnQctI2zD2f3J@XnF@TqpeTn66RpqGkpaWlg4QaylpanJhkcIhjF0DSPV/AA "JavaScript (Node.js) – Try It Online")
---
# JavaScript (ES6), 31 bytes
[Returns a Boolean value](https://codegolf.meta.stackexchange.com/a/9067/58563) instead of **0** / **1**.
```
s=>([a,b]=s.split`,`,a<b?2:a>b)
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@7/Y1k4jOlEnKda2WK@4ICezJEEnQSfRJsneyCrRLknzf3J@XnF@TqpeTn66hnaahpKWlpYOEGspaWpyYZPDJY5DC0j9fwA "JavaScript (Node.js) – Try It Online")
[Answer]
# [Ruby](https://www.ruby-lang.org/) -nl, 18 bytes
```
~/,/;p ($`<=>$')%3
```
[Try it online!](https://tio.run/##KypNqvz/v05fR9@6QEFDJcHG1k5FXVPV@P9/LS0tHSDm0uHSgjK1uCAMLqgMlATxgGyQKJeO1r/8gpLM/Lzi/7p5OQA "Ruby – Try It Online")
Takes input from STDIN. Compares the regex match groups `$`` and `$'`, which are set equal to everything on the left and right of the comma, respectively.
[Answer]
# [Io](http://iolanguage.org/), 51 bytes
Mod3 doesn't work in Io. Too bad.
```
method(x,I := -x compare(x reverse);if(I== -1,2,I))
```
[Try it online!](https://tio.run/##y8z/n6ZgZasQ8z83tSQjP0WjQscTxNetUEjOzy1ILErVqFAoSi1LLSpO1bTOTNPwtAVKGuoY6Xhqav5P01DS0tLSAWItJU2FgqLMvJKcPC6oKKYIhjIkNf8B "Io – Try It Online")
[Answer]
# [brainfuck](https://github.com/TryItOnline/brainfuck), 57 bytes
```
-[>>,<--[>-<++++++]>-]<+[<<,]>[<-->+[<+>+]]-[<+>-----]<-.
```
[Try it online!](https://tio.run/##HYnBCYBAEAML2osVhDSy5KGCIIIPwfrXPeczA7M963kf735VIaVBtMD4sWBGksPKPuoOhY1pTEwsVR8 "brainfuck – Try It Online")
It spreads `*` on the tape and checks if the second branch went past the first.
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki/The-Language), ~~15~~ 13 bytes
```
(.*),\1$
\*+
```
[Try it online!](https://tio.run/##K0otycxLNPyvquGe8F9DT0tTJ8ZQhYsrRkv7/38tLS0dLTDggjHBDCgPJsilAwA "Retina – Try It Online")
If the right-hand-side has an equal or less number of `*`'s, then those `*`'s are removed from both sides, along with the `,`.
Then the number of runs of `*`'s are counted.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~9~~ 8 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
[Returns `true/false` instead of `1/0`](https://codegolf.meta.stackexchange.com/a/9067/58563)
```
>Ô?2:U<Ô
>Ô?2:U<Ô     :Implicit input of string U
>            :Greater than
 Ô           :  U reversed
  ?          :If true
   2         :  Literal 2
    :        :Else
     U<Ô     :  U less than U reversed?
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=PtQ/MjpVPNQ&footer=wlU&input=IioqKioqLCoqKioqIg)
# Original, 9 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
5 bytes just to handle the I/O requirements :\
```
q, mÊrÎu3
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=cSwgbcpyznUz&input=IioqKioqKiwqKioqKiI)
```
q, mÊrÎu3     :Implicit input of string
q,            :Split on ","
   m          :Map
    Ê         :  Length
     r        :Reduce by
      Î       :  Sign of difference
       u3     :Positive modulo 3
```
If we could take a space delimited string as input then -2 bytes:
```
¸mÊrÎu3
```
If we could take an array as input then -1 more byte:
```
mÊrÎu3
```
And, if we could use any 3 distinct values for the output then -2 more bytes:
```
mÊrÎ
```
[Answer]
# Java 10, ~~74~~ ~~51~~ 50 bytes
```
s->(Long.signum(s.indexOf(44)*2-s.length()+1)+3)%3
```
-24 bytes thanks to *@OlivierGrégoire*.
[Try it online.](https://tio.run/##jY7LCsIwEEX3/YpBEJLUBnzsin6Bj4VLcRHTWFPTqTipKNJvr/G1bmcxzONy7i3UTSVFdm61U0SwUhafEYBFb65HpQ2s3yuAqzAHzbb@asNAPA3XJgqNvPJWwxoQ5i0lC7YMSkk2x7pkJC1m5r45stmMi0lC0hnM/YnxeMzjKR9O2/QNudQHFyA/1q2yGZQhyc9utwfFvzG2D/KmlFXt5SW8vEOGUrOBEGIkPjXgn2zd0l7CnrS@pp26bsPRH9JETfsC)
**Explanation:**
```
s->{                          // Method with String parameter and long return-type
  Math.signum(                //  Take the signum of:
   s.indexOf(44)              //   The index of ',' (codepoint 44)
   *2                         //   multiplied by 2
   -s.length()                //   Subtract the entire length of the input
   +1                         //   And add 1
  +3)                         //  Then increase that result by 3
  %3                          //  And take modulo-3 on it
```
[Answer]
# [Ruby](https://www.ruby-lang.org/) -n, ~~21~~ 20 bytes
```
p (~/,/*2<=>~/.$/)%3
```
[Try it online!](https://tio.run/##KypNqvz/v0BBo05fR1/LyMbWrk5fT0VfU9X4/38tLS0dIObS4dKCMrW4IAwuqAyUBPGAbJAol47Wv/yCksz8vOL/unkA "Ruby – Try It Online")
[Answer]
# [J](http://jsoftware.com/), ~~19~~ 18 bytes
```
3|i.&','*@--:@<:@#
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/jWsy9dTUddS1HHR1rRxsrByU/2v@T1NQ19LS0gFidS44G4kJ5eioAwA "J – Try It Online")
### How it works
```
3|i.&','*@--:@<:@#
           -:@<:@# halved (length-1) of list
                   (where , would be in a balanced list)
  i.&','           position of the ,
        *@-        signum'd difference between both
3|                 mod 3
```
## Alternative version, 19 bytes
This inserts `-` and `+` between the bit mask of the string: `**,* -> 1 1 0 1 -> 1 + (1 + (0 - 1)))` to get the difference between both sides. Then both signum and mod 3 like other solutions.
```
3|[:*'*'-`+@.[/@:=]
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/jWuirbTUtdR1E7Qd9KL1HaxsY/9r/k9TUNfS0tIBYnUuOBuJCeXoqAMA "J – Try It Online")
### How it works
```
3|[:*'*'-`+@.[/@:=]
     '*'         =] '***,*' -> 1 1 1 0 1
        -`+@.[      a function that chooses - or + based on the left argument
              /@:   puts this function inbetween: 1+(1+(1+(0-1))) = 2
  [:*               signum: 2 -> 1
3|                  mod 3
```
[Answer]
# [Befunge-93](https://github.com/catseye/Befunge-93), 31 bytes
```
2>1~:1+v
p^_"$"2 0
.@^-","_$2\-
```
[Try it online!](https://tio.run/##S0pNK81LT/3/38jOsM7KULuMqyAuXklFyUjBgEvPIU5XSUcpXsUoRvf/fy0tLR0gBgA "Befunge-93 – Try It Online")
After initially pushing `2` to the stack, we push `1` for every `*` we encounter. After finding the `,`, we start popping them instead. When we run out of input we subtract the top of the stack from 2, resulting in the correct output values.
[Answer]
## Excel, ~~*44*~~ 40 Bytes
```
=MOD(3-SIGN(1+LEN(A1)-2*FIND(",",A1)),3)
```
Finds the difference between Total Length + 1 and twice the position of the comma (Negative: Left; Zero: Tie; Positive: Right), use `SIGN` to convert these into `-1`, `0` and `1`. Then subtract this from 3 to give `4`/`0`/`2`, and take the Modulo Base 3 (`1`, `0`, `2`)
**Old version: 44 Bytes**
```
=MID(102,2+SIGN(1+LEN(A1)-2*FIND(",",A1)),1)
```
Finds the difference between Total Length + 1 and twice the position of the comma (Negative: Left; Zero: Tie; Positive: Right), use `SIGN` to convert these into `-1`, `0` and `1`, add 2 (`1`, `2`, `3`), and then use `MID` to take the first, second or third digit from `102`, respectively.
(Using `MID` saved 3 bytes over using `CHOOSE`)
I also experimented with a more maths-based approach (Multiply the Sign by 1.5, round it in the Positive direction with `CEILING`, then take the Absolute value), but that was 51 bytes instead.
[Answer]
# [Python 3](https://docs.python.org/3.8/), 56 60 bytes
-4 bytes thanks to math junkie
A third approach to this in python.
```
def f(x):a,b=x.split(',');return(1,0,2)[((a<b)-(a>b))+1]
```
[Try it online!](https://tio.run/##K6gsycjPM/7/PyU1TSFNo0LTKlEnybZCr7ggJ7NEQ11HXdO6KLWktChPw1DHQMdIM1pDI9EmSVNXI9EuSVNT2zD2f0FRZl6JRpqGupaWlo6WlrqmJhdCCEMAQwRThZYOqgIQ7z8A "Python 3 – Try It Online")
[Answer]
# [C (gcc)](https://gcc.gnu.org/) - 67 bytes
This is a complete program and can be compiled with gcc. Input is the first command line argument and output is the exit status.
```
main(u,v)int**v;{u=strlen(*++v)-strspn(*v,"*")*2;exit(u>1?2:u!=1);}
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 83 bytes
```
x;f(char*z){char*Z,*W;for(Z=z;44-*Z++;);for(W=Z;*W++;)Z--;x=!!x*((x=z-Z+1)<0?1:2);}
```
[Try it online!](https://tio.run/##NYxLCsIwEIav0gYKk0kGrHTlGDxGIXRTItEurBKlhBbPHpuAi@F/MZ@jm3MpRfbg7mPAVW5Frcae/TOANSt3HaFVimVpemMZ@xwtEUdT1xEBolnJqlaeD5f2dJT8TdP8qR7jNEM2ThcsLnLLDF6U0kSO5SvsswfhYRDNexCyMlVzHWahcdEe9ofMSoio98Ni/inpHw "C (gcc) – Try It Online")
# [C (gcc)](https://gcc.gnu.org/), 58 bytes
* Thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat) for this shorter version.
```
f(z,Z)long z,Z;{Z-=strlen(Z=index(z,44))+z-1;z=Z<0?2:!!Z;}
```
[Try it online!](https://tio.run/##NYzBCoMwEER/JQaE3XUDbfHUNPQ/ghdJjRVsLFGkKP32NC30MPCGx4xTvXMpedjY4jiFXmTQu1VmXuLYBbBmCLfulX1dI1abOurN2MvhejoXhdXvNIRFPNohwBccu3sbiVbc/RRBr1XFSjmNz5i1B@mhkeXcSBRGlLcmSKaVPeQB5q9ERJxDP/i3xB8 "C (gcc) – Try It Online")
[Answer]
# Excel, ~~64~~ ~~63~~ 62 bytes
```
=IF(LEN(A1)+1=2*FIND(",",A1),0,IF(LEN(A1)<2*FIND(",",A1),1,2))
```
-1 byte thanks to Dominic van Essen
-1 byre thanks to Chronocidal
[Answer]
# [PHP](https://php.net/), ~~55~~ ~~51~~ 47 bytes
```
fn($s)=>(3+(($a=explode(',',$s))[0]<=>$a[1]))%3
```
[Try it online!](https://tio.run/##K8go@G9jX5BRwKWSZvs/LU9DpVjT1k7DWFtDQyXRNrWiICc/JVVDXUddByihGW0Qa2Nrp5IYbRirqalq/N@aiys1OSNfQSVNQ0lLS0sHiLWUNPWUYvKUrFFlsItiVQ5X@x8A "PHP – Try It Online")
This is the best I have so far.. Gosh, longer than Java and C :O
EDIT: saved 4 bytes using value of `$v`, now shorter than C!
EDIT2: thanks a lot to 640KB for finding the finely elegant way to have the right numbers! -4 bytes
Much shorter with only distinct values instead of fixed numbers requirement:
# [PHP](https://php.net/), 39 bytes
```
fn($s)=>($a=explode(',',$s))[0]<=>$a[1]
```
[Try it online!](https://tio.run/##K8go@G9jX5BRwKWSZvs/LU9DpVjT1k5DJdE2taIgJz8lVUNdR10HKKgZbRBrY2unkhhtGPvfmosrNTkjX0ElTUNJS0tLB4i1lDT1lGLylKxRZbCLYlUOV/sfAA "PHP – Try It Online")
[Answer]
# [Python 3.8 (pre-release)](https://docs.python.org/3.8/), 62 bytes
```
lambda x:y.index(max(y))+1if len({*(y:=x.split(","))})>1else 0
```
[Try it online!](https://tio.run/##VY/BisMgEIbP61MMc1KbhqR7KQF772lfoFCy1FAhNRInkFD67Fm1mN0VdHT@b2Z@3UL3wX4e3bh26rL27eP71sLcLKWxNz3zRzvzRYhdbTroteVPyZdGzaV3vSGOBQrxEqda915DtZL25EEBIp6tm6gBKWURtvz4miglDuyPsmVr9p/fhCoLv2wVujPWDSPEcWBsij5bulgUDYOwrsYWcB0mCo4ishGEIgNBCmfpaTSOZ9NZfpcaSzxeM5R9hK8nzI2JiMNwvz9hAV18iRxBqdTqTa8/ "Python 3.8 (pre-release) – Try It Online")
I know that there is a shorter python solution already posted, but `cmp` doesn't exist in python 3. And don't bother trying to use bitwise operators to increment the value... it ends up being the same byte count.
[Answer]
# [Ruby](https://www.ruby-lang.org/) `-nlaF,`, 22 bytes
```
p ($F[0]<=>$F[1]||1)%3
```
[Try it online!](https://tio.run/##KypNqvz/v0BBQ8Ut2iDWxtYOSBvG1tQYaqoa//@vpaWlA8RaXCAGF5THpcMFov7lF5Rk5ucV/9fNy0l00wEA "Ruby – Try It Online")
]