Okay, this kata should be sent to draft, because the reference solution doesn't even cohere to the description:
Reference solution considers "balanced hand" to be no voids, no singletons, no five-card majors. This is not the standard definition of a balanced hand (no voids, no singletons, at most one doubleton)
Description on 2C rule is wrong: see issue below
Weak Two Bid rule is wrong: see issue below. Even then, the random test almost never hits this case, so this needs to be specifically tested
Minor opener description is complete garbage: it does not specify the actual bidding rule other than 3-3 and 4-4, which is open 1D/1C if 3+ D/C cards, take the longer suit, then suit rank if equal
Reference solution expects wrong minor opener when there are 5-5/6-6 D/C cards respectively (expects 1D instead of 1C, which is the higher suit)
Bidding rule precedence is completely different from the order specified by the description: precedence taken by the reference solution is NT > 2C > Major opener (longest suit > highest suit) > Minor opener (4-4 > 3-3 > longest suit > highest suit), which I don't think is correct in practice
Notrump openings show a balanced hand and can be made with a five-card minor suit
The current version of SAYC says Notrump openings show a balanced hand and may be made with a five-card major suit or a five-card minor suit. Notably, suits are not limited to minor suit.
(I think most SAYC variants does this as well AFAIK)
Notrump openings show a balanced hand and can be made with a five-card minor suit.
Then why does 7H 8D AD KC 9H KH 5D AS 7C 9C QC 3S 8H return 1N? Both minor suits have 4 and 3 respectively. Are you refering to the sum of cards for both minor suits?
How is "balanced hand" (or "unbalanced hand") defined?
The description is only describing part of the actual bidding rules: rules for pass aren't explained. Are we supposed to pass when no bidding criteria are met?
Also, what was the suit order again? It is not universally DCHS in every card game.
As far as I know CW never takes account of "ouput" (I suppose "output" a value is for you "printing" a value ?).
Besides that in the descriprion you have
"If a1 and/or a2 are empty return -1 in each language except in Haskell (F#) where you will return Nothing (None)."
So you can suppose you have to "return" a value.
In the Typescript scaffolding, no return type is notated.
Right. As the time of writing (5 years ago) it was not needed.
I added it this morning when I first saw your message. Did that fix the problem for you? It's frustrating that the system didn't tell me there was a problem. You're the first person to mention it. Hopefully it's working for you now.
I'm extremely sure this rule is intended to be at least the specified number of top honours, not the exact amount of honors.
It is not mentioned that at least 5 cards are required for Weak Two Bidding (aka the second portion of the bidding rule).
Okay, this kata should be sent to draft, because the reference solution doesn't even cohere to the description:
no voids, no singletons, no five-card majors
. This is not the standard definition of a balanced hand (no voids, no singletons, at most one doubleton
)2C
rule is wrong: see issue below3-3
and4-4
, which isopen 1D/1C if 3+ D/C cards, take the longer suit, then suit rank if equal
5-5
/6-6
D/C cards respectively (expects1D
instead of1C
, which is the higher suit)NT
>2C
> Major opener (longest suit > highest suit) > Minor opener (4-4
>3-3
> longest suit > highest suit), which I don't think is correct in practiceThe rule in the description is wrong: it's actually
With 22+ point, if not legible for 3NT, open 2C
.In the actual tests
AC KD KC AD 5S TH 9D 2H TS AH KS 2C JS
expects2C
, but this is a balanced hand (4-3-3-3
).The current version of SAYC says
Notrump openings show a balanced hand and may be made with a five-card major suit or a five-card minor suit
. Notably, suits are not limited to minor suit.(I think most SAYC variants does this as well AFAIK)
What is a
top 3
honour?AKQ
?What is a
long suit
? What if there are multiple long suits?Then why does
7H 8D AD KC 9H KH 5D AS 7C 9C QC 3S 8H
return1N
? Both minor suits have4
and3
respectively. Are you refering to the sum of cards for both minor suits?How is "balanced hand" (or "unbalanced hand") defined?
What if there are, say, 6 Spades and 7 Hearts? Which one takes precedence?
What should be the number?
1
, or number of the cards of that suit?The description is only describing part of the actual bidding rules: rules for
pass
aren't explained. Are we supposed topass
when no bidding criteria are met?Also, what was the suit order again? It is not universally
DCHS
in every card game.As far as I know CW never takes account of "ouput" (I suppose "output" a value is for you "printing" a value ?).
Besides that in the descriprion you have
"If a1 and/or a2 are empty return -1 in each language except in Haskell (F#) where you will return Nothing (None)."
So you can suppose you have to "return" a value.
Right. As the time of writing (5 years ago) it was not needed.
It's not clear whether you're to
return
a value or output a value. In the Typescript scaffolding, no return type is notated.Well, it's due to the new runner which stops concatenation user code with the tests, mandating the tests to import the libraries themselves.
I added it this morning when I first saw your message. Did that fix the problem for you? It's frustrating that the system didn't tell me there was a problem. You're the first person to mention it. Hopefully it's working for you now.
You forgot to
from collections import Counter
yourself in the test fixture.Loading more items...