Golf Golf!
This is my first challenge, so please be gentle! The challenge is to write a program that will output the correct score for a layout in the card game "Golf."
The card game Golf has many variations. The house rules I use follow the standard rules for Six-Card Golf given by Pagat, with one slight difference. There is already a similar challenge here but I think this one is more interesting because it requires you to take the orientation of the cards into account.
Each player has a 2x3 layout of cards. By the end of each round all cards are turned face up and scored as follows:
- Each ace counts 1 point.
- Each two counts minus two points.
- Each numeral card from 3 to 10 scores face value.
- Each Jack or Queen scores 10 points.
- Each King scores zero points.
- A pair of equal cards in the same column scores zero points for the column (even if the equal cards are twos).
- A set of three equal cards in the same row scores zero points for the row (even if the equal cards are twos).
Input
The input can be a string or array of any kind.
Output
An integer representing the score of the Golf hand.
Examples
These examples use the notation A23456789TJQK
but you need not use that notation in your answer.
Layout
AK3
J23
Score
9
-----------------------
Layout
25Q
25J
Score
20
-----------------------
Layout
T82
T8A
Score
-1
-----------------------
Layout
QQQ
234
Score
5
-----------------------
Layout
TJQ
QTJ
Score
60
-----------------------
Layout
888
382
Score
1
-----------------------
Layout
888
888
Score
0
This is code golf, so the shortest answer in bytes wins!
A23456789TJQK
but you need not use that notation in your answer." \$\endgroup\$JJJ 2J2
->-4
. \$\endgroup\$