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

chore: Develop #4

Merged
merged 3 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

class PlaceBid:
def __init__(self, place_bid_request):
print("type", type(place_bid_request))
place_bid_request = dict(place_bid_request)
self.vuln = VULNERABILITIES[place_bid_request['vuln']]
self.hand = place_bid_request['hand']
Expand Down
2 changes: 1 addition & 1 deletion src/bots.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def get_binary(self, auction):
def restful_bid(self, auction) -> BidResp:
start = time.time()
auction = [element for element in auction if element != "PAD_START"]
self.getting_doubled = len(auction)>=3 and (auction[-3:]==['X',"PASS","PASS"] )
self.getting_doubled = len(auction)>=3 and ((auction[-3:]==['X',"PASS","PASS"] ) or auction[-2:]==['XX',"PASS"])
self.min_candidate_score = 0.01 if self.getting_doubled else self.min_candidate_score

position_minus_1 = len(auction) % 4
Expand Down
6 changes: 3 additions & 3 deletions src/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,12 @@ def compare_two_tests(set_of_boards_1: List[Board], set_of_boards_2: List[Board]


if __name__ == "__main__":
run_tm_btwn_ben_versions(force_same_card_play=True,force_same_lead=True)
# run_tm_btwn_ben_versions(force_same_card_play=True,force_same_lead=True)
# tests = run_tests()
# compare_two_tests(load_test_pbn("avant.pbn"),
# load_test_pbn("après.pbn"))
# load_test_pbn("c4f380988fc67c0fe6e5f4bc5502d67a3b45d2c0.pbn")
# link = r"https://play.intobridge.com/hand?lin=pn%7CBen,Etha,Ben,Ben%7Cmd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