Skip to content

Shell utilities#170

Open
tameware wants to merge 12 commits into
dds-bridge:developfrom
tameware:shell-utilities
Open

Shell utilities#170
tameware wants to merge 12 commits into
dds-bridge:developfrom
tameware:shell-utilities

Conversation

@tameware
Copy link
Copy Markdown
Contributor

@tameware tameware commented Jun 5, 2026

Added dd_table_for_deal.cpp and dd_table_for_deal.py. These take a PBN file or string as input and produce a hand diagram and table of the deal's 20 double-dummy results.

@tameware tameware marked this pull request as ready for review June 5, 2026 06:23
@tameware
Copy link
Copy Markdown
Contributor Author

tameware commented Jun 5, 2026

Please ask Copilot to have a look.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new command-line utilities (C++ and Python) that accept a PBN deal (string or .pbn file) and print a hand diagram plus the 5×4 (20-cell) double-dummy result table, integrating them into the existing Bazel examples layout.

Changes:

  • Add examples/dd_table_for_deal.cpp and wire it into //examples:dd_table_for_deal.
  • Add python/examples/dd_table_for_deal.py plus //python/examples:dd_table_for_deal and usage docs.
  • Add several sample .pbn files under hands/ and reference the new utility from examples/README.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
python/examples/README.md Documents how to run the new Python example (needs fixes to Bazel invocation and a non-existent target reference).
python/examples/dd_table_for_deal.py Implements the Python CLI: load deal from arg/stdin/file, render diagram, and print the 20-result table via calc_all_tables_pbn.
python/examples/BUILD.bazel Adds a py_binary target for the Python example.
hands/example.pbn Adds a simple example deal for CLI demos.
hands/all_solid.pbn Adds a sample deal file.
hands/12_cards.pbn Adds a deliberately short/invalid-looking sample deal file.
hands/everyone_makes_3N.pbn Adds a constructed deal sample.
hands/thomas1.pbn Adds a “time consuming” sample deal.
hands/thomas2.pbn Adds a “time consuming” sample deal.
examples/README Mentions the new Python example and lists the new C++ example.
examples/dd_table_for_deal.cpp Implements the C++ CLI utility (reads [Deal \"...\"] from stdin/file or accepts a PBN string).
examples/BUILD.bazel Adds the new C++ example target and includes it in the examples filegroup.

Comment thread python/examples/README.md
Comment thread python/examples/README.md
Comment thread python/examples/README.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@tameware tameware marked this pull request as draft June 5, 2026 16:08
@tameware tameware marked this pull request as ready for review June 5, 2026 16:46
@tameware
Copy link
Copy Markdown
Contributor Author

tameware commented Jun 6, 2026

Ready for human review.

As with the other examples, there are no unit tests. I've added Issue #171 to add them.

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

Successfully merging this pull request may close these issues.

2 participants