# [R], 41 bytes <!-- language-all: lang-r --> function(v)rank(c(6,0,5,1:4*0,1:3)[v])[1] [Try it online!][TIO-jjkhewbr] [R]: https://www.r-project.org/ [TIO-jjkhewbr]: https://tio.run/##Zc9BCsIwEAXQfU/xoZtEgiS1lSKNFykuYkxp0SbSiV6/hmpFcDMM/zMPZpo7PXcPb@MQPHvyyfgrs2wvpKiEOpQbmeaOt88Tb9VpzlFgdMYTjgLqszZp3VbQOsu6dKsESs6R4wgwYx3IhskRlMI9DD5S6tdMfqNumChiIGBMDWJvPMjZ4C98UWuB3aI2Sa3X@yKlX1/@KDdH9I9UAsWCaA1WwfhL@uccYv82IPn8Ag "R – Try It Online" The function returns `2` for `'greater than'`, `1` for `'less than'`, `1.5` for `'equal'` **Explanation :** c(6,0,5,1:4*0,1:3)[v] # extract the score of each card in v; # cards in v are used as indexes in the cards rank # vector, which is based on briscola scores vector # c(11,0,10,0,0,0,0,2,3,4) but divided by 2 and rounded # to integer preserving the original order rank( )[1] # rank returns : c(1, 2) if v[1] < v[2] # c(2, 1) if v[1] > v[2] # c(1.5,1.5) if v[1] == v[2] # and we select the first value