Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

par function dealer parameter usage/bug? #57

Open
LGTrader opened this issue Aug 15, 2024 · 0 comments
Open

par function dealer parameter usage/bug? #57

LGTrader opened this issue Aug 15, 2024 · 0 comments

Comments

@LGTrader
Copy link

I have been unable to write a code example that demonstrates what the dealer parameter of the par() function is supposed to do. Is this a known/unknown bug or can someone show me what I'm doing wrong?

Example code follows:

from endplay.types import Board, Contract, Deal
from endplay.dds import par, calc_dd_table

b = Board()
b.dealer = 0

b.contract = Contract()

b.contract.level = 0
b.contract.denom = 0
b.contract.declarer = 0
b.contract.result = 0
b.deal = Deal()

b.deal.north = 'K.AQ8742.K642.32'
b.deal.east = 'AQ92.KT96.98.865'
b.deal.south = 'JT3.J5.QJ5.AK974'
b.deal.west = '87654.3.AT73.QJT'

deal = b.deal.copy()
table = calc_dd_table(b.deal)
table.pprint()
print('\n====\n', deal)

par_result1 = par(deal, vul=0, dealer=0).score
print(par_result1)

par_result2 = par(table, vul=0, dealer=1).score
print(par_result2)

par_result3 = par(table, vul=0, dealer='A bogus entry').score
print(par_result3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant