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

Unbal5 vs 4333 #48

Closed
wants to merge 18 commits into from
Closed

Unbal5 vs 4333 #48

wants to merge 18 commits into from

Conversation

mycroftw
Copy link

Add a sim

Logic fixes:
- if "is_clubs", only count other suit if equal or longer than club suit
  (rather than >=5).
- only store one "longest suit" per hand (the highest suit by fiat)
- keep track of matches, and report on both total deals generated and
  total matched.

Cleanup:
- function typing.
- PEP 8 issues (mostly "move initial setup to __init__()")
- use Counter rather than generic dict.
- x += 1 rather than x=x+1
- use Python 3 key function sorting, and "guaranteed order" sorting
  rather than complicated comparison function.
- pprint rather than dumb formatting.
- function typing.
- use Counter rather than generic dict.
- pprint rather than dumb formatting.
- PEP8 and Sourcery issues.
Should just get used to always doing this.
Almost all:
- docstrings
- rename files for "don't start with number"
- rename files for "snake_case"
- format -> f-string
Recent changes to anntzer/redeal
@anntzer
Copy link
Owner

anntzer commented May 20, 2024

These are nice examples, but I'd rather not add them to the repo (unless they illustrate very specific points of redeal usage), as otherwise it's a bit hard to see where to stop... Feel free to discuss if there are specific reasons to include them.

@anntzer anntzer closed this May 20, 2024
@mycroftw
Copy link
Author

Many apologies. Learning to use github with forked repos. Made a mistake.

This was intended to update my examples (hence the rather strange directory name).

As you may be able to see from the commits, I was pylint-ing and black-ing for consistency.

I thought I had cancelled the PR, so that you would have no need to close. Again, my apologies.

I'm glad you think they are interesting examples (and coded to the level you might actually care). I don't see there is anything there that is really "special bit of redeal", except maybe the 3NT vs 6D one (a simple straightforward "given two hands, what's the chance contract A or B makes?" example - that could be augmented simply by adding "DD which scores better" or your new "par" function.

But mostly - sorry for my fumble. Didn't mean to cause you to waste time.

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