Shell utilities#170
Open
tameware wants to merge 12 commits into
Open
Conversation
Contributor
Author
|
Please ask Copilot to have a look. |
Contributor
There was a problem hiding this comment.
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.cppand wire it into//examples:dd_table_for_deal. - Add
python/examples/dd_table_for_deal.pyplus//python/examples:dd_table_for_dealand usage docs. - Add several sample
.pbnfiles underhands/and reference the new utility fromexamples/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. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
Author
|
Ready for human review. As with the other examples, there are no unit tests. I've added Issue #171 to add them. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
dd_table_for_deal.cppanddd_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.