11
1
Introduction
Briscola is one of Italy's most popular card games. It is a trick-taking card game, like Bridge. Briscola is well known for its bizarre point system. In this challenge, given two cards, you will output whether the first one scores more, less, or the same number of points as the second in Briscola's point system.
Challenge
Briscola is played with a deck of Italian playing cards. There are forty cards in a deck, 1-10 in each of the four suits: cups, swords, clubs, and coins. We will be ignoring the suits for this challenge. Cards 2 - 7 are the numeric cards, and cards 8, 9, and 10 are the face cards. The ranking of the cards, from highest to lowest, are:
+------------------------+-------------+
| Cards, by Rank | Point Value |
+------------------------+-------------+
| Ace (1) | 11 |
| Three (3) | 10 |
| King (10) | 4 |
| Knight (9) | 3 |
| Jack (8) | 2 |
| Numeric Cards (2, 4-7) | 0 |
+------------------------+-------------+
Thanks to Orphevs for the nice table! :)
Your task is to create a full program or function which accepts two numbers 1-10 representing card ranks, and outputs (or returns) whether the point value of the first card is greater than, lesser than, or equal to the point value of the second card. Additional Notes:
- Your program may output any three values to indicate less than, greater than, and equal to, however, it must output the same value for each condition each time.
- Your program may use any IO defaults.
- Standard loopholes are disallowed.
- Either a full function or a program is permitted.
This question is code-golf, so lowest byte-count wins.
Here are some sample inputs and outputs:
1, 4 => more than (ace scores 11 points, 4 scores 0 points, first is more than second. 8, 3 => less than (8 scores 2, 3 scores 10, first is less than second. 5, 2 => equal (5 and 2 both score 0)
If you have any questions, don't hesitate to ask. Good luck!
1
I always thought Scopa's primiera was more bizarre ;)
– FryAmTheEggman – 2018-07-12T22:08:11.320@FryAmTheEggman you're right, I've changed it. Also, you may have a point about the primiera… ;) – Amphibological – 2018-07-12T22:51:04.700
Can we take an array with the two values as input ? – digEmAll – 2018-07-13T18:05:27.623
1@digEmAll sure thing. – Amphibological – 2018-07-13T19:23:08.630
Not that bizarre. Very similar scoring exists on Portuguese Sueca and Bisca card games! – sergiol – 2018-07-13T23:15:09.387
Why usual negative, zero, positive is disallowed? – Qwertiy – 2018-07-17T14:46:10.663
@Qwertiy what do you mean? I say above that you can output any three consistent values. – Amphibological – 2018-07-17T16:49:45.803
@Amphibological, i mean that a lot of languages use comparator returning a) nigative value - the first argument is smaller; b) zero - they are equal; c) positive value - the first is greater. But you are requiring constant values. – Qwertiy – 2018-07-17T19:52:53.780
@Qwertiy I think you are misunderstanding me. What you have mentioned is completely fine: you are returning consistent values for the different comparisons, which is all the challenge specifies. – Amphibological – 2018-07-17T21:19:57.803
@Amphibological, from the question: "output any three values ... however, it must output the same value for each condition each time" also note using
Math.sign
in many answers. – Qwertiy – 2018-07-17T22:23:06.387@Qwertiy I apologize if my wording is confusing. The meaning was supposed to be that each condition ( less than, greater than, equal to) would yield the same value on each run. All the answers below, are as far as I can tell, valid. – Amphibological – 2018-07-17T22:40:01.027
@Amphibological, but without
Math.sign
, they wouldn't be valid, right? – Qwertiy – 2018-07-18T06:41:38.170@Qwertiy yes, that's correct. – Amphibological – 2018-07-18T12:55:29.660
I did game it many years ago with my relatives (parenti) – RosLuP – 2019-10-19T09:04:10.340