-
Notifications
You must be signed in to change notification settings - Fork 8
Description
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)