Draft

Bridge: SAYC Openings

Description
Loading description...
Games
Algorithms
View
AllIssues5Questions1SuggestionsShow Resolved
  • Please sign in or sign up to leave a comment.
  • Voile Avatar

    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
  • Voile Avatar

    With 22+ points and an unbalanced hand, open 2C

    In the actual tests AC KD KC AD 5S TH 9D 2H TS AH KS 2C JS expects 2C, but this is a balanced hand (4-3-3-3).

    • Voile Avatar

      The rule in the description is wrong: it's actually With 22+ point, if not legible for 3NT, open 2C.

  • Voile Avatar

    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)

    • Voile Avatar

      If you have 6+ HCP and a long suit with 2 of the top 3 or 3 of the top 5 honours:

      I'm extremely sure this rule is intended to be at least the specified number of top honours, not the exact amount of honors.

  • Voile Avatar

    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.

    • Voile Avatar

      Normally open five-card majors in all seats.

      What if there are, say, 6 Spades and 7 Hearts? Which one takes precedence?

      Open the higher of long suits of equal length: 5-5 or 6-6.

      What should be the number? 1, or number of the cards of that suit?

    • Voile Avatar

      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?

    • Voile Avatar

      If you have 6+ HCP and a long suit with 2 of the top 3 or 3 of the top 5 honours:

      What is a top 3 honour? AKQ?

      What is a long suit? What if there are multiple long suits?

    • Voile Avatar

      It is not mentioned that at least 5 cards are required for Weak Two Bidding (aka the second portion of the bidding rule).

  • Voile Avatar
    Traceback (most recent call last):
      File "main.py", line 140, in <module>
        Test.assert_equals(bid(hand), reference(hand))
      File "main.py", line 71, in reference
        dist = Counter([x[-1] for x in hand])
    NameError: name 'Counter' is not defined
    
    • Perlkonig Avatar

      This hasn't come up before, and the code is validating fine. Is this happening to you every time you run your code?

    • Voile Avatar

      You forgot to from collections import Counter yourself in the test fixture.

    • Perlkonig Avatar

      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.

      Issue marked resolved by Perlkonig 7 years ago
    • Voile Avatar

      Well, it's due to the new runner which stops concatenation user code with the tests, mandating the tests to import the libraries themselves.

  • JohanWiltink Avatar
    • a number between 2 and 7 followed by a suit (e.g., 2C, 3N, 4H)

    ?!?

    Shouldn't that be 1 and 7 ?

  • smile67 Avatar

    This comment has been hidden.