DDS table for contract bridge
Project description
Introduction
A DDS (double-dummy solver) function is available through Bo Haglund's DDS 2.9.0. For Windows, the DDS DLL is distributed with are distributed together.
The solution used here is copied from below two opensource project, credit to them
this project focus on DDS table only like below
$ ./ddstable.py
S H D C NT
N - 4 2 - 3
S - 4 2 - 3
E 3 - - - -
W 3 - - - -
How to use it
from ddstable import ddstable
PBN = b"E:QJT5432.T.6.QJ82 .J97543.K7532.94 87.A62.QJT4.AT75 AK96.KQ8.A98.K63"
all = ddstable.get_ddstable(PBN)
print("{:>5} {:>5} {:>5} {:>5} {:>5} {:>5}".format("", "S", "H", "D", "C", "NT"))
for each in all.keys():
print("{:>5}".format(each),end='')
for suit in dcardSuit:
trick=all[each][suit]
if trick>7:
print(" {:5}".format(trick - 6),end='')
else:
print(" {:>5}".format("-"),end='')
print("")
or
>>> from ddstable import ddstable
>>> PBN = b"E:QJT5432.T.6.QJ82 .J97543.K7532.94 87.A62.QJT4.AT75 AK96.KQ8.A98.K63"
>>> ddstable.get_ddstable(PBN)
{'N': {'S': 4, 'H': 10, 'D': 8, 'C': 6, 'NT': 9}, 'S': {'S': 4, 'H': 10, 'D': 8, 'C': 6, 'NT': 9}, 'E': {'S': 9, 'H': 2, 'D': 3, 'C': 7, 'NT': 3}, 'W': {'S': 9, 'H': 2, 'D': 3, 'C': 7, 'NT': 3}}
Reference
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ddstable-0.0.1.tar.gz
(82.0 kB
view details)
Built Distribution
ddstable-0.0.1-py3-none-any.whl
(81.1 kB
view details)
File details
Details for the file ddstable-0.0.1.tar.gz
.
File metadata
- Download URL: ddstable-0.0.1.tar.gz
- Upload date:
- Size: 82.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8ce864311c3ac44c5f92087abb0599af8c5eb6c8e85340ebaed2d295789987b |
|
MD5 | 06b1effaecbbee00370c62d3a4eaa49b |
|
BLAKE2b-256 | a4a8c7da138499e53b1b17bc7b221d5b9855883281cd4b840c913266364b16fe |
File details
Details for the file ddstable-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: ddstable-0.0.1-py3-none-any.whl
- Upload date:
- Size: 81.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fbf0682bb6b34c4bf5f77f55f69069c714cd6046262ba7d48cd2e784aad5afb |
|
MD5 | 03cb0faebe057eeaeff394ced19af4db |
|
BLAKE2b-256 | 9dbfa8abd2845b92d18a55a04d5ac18229aed3cef1382f8086fe287209885f3b |