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

Hokm, Whist, and Forty-One could use refactoring #13

Open
sunfall opened this issue Apr 24, 2015 · 1 comment
Open

Hokm, Whist, and Forty-One could use refactoring #13

sunfall opened this issue Apr 24, 2015 · 1 comment
Labels
cleanup Code cleanup, refactoring, and other tidying.

Comments

@sunfall
Copy link
Owner

sunfall commented Apr 24, 2015

All three of those games use the same copy-and-pasted code for playing cards and evaluating the tricks on the table. Making those "library" functions that all trick-taking games could use (remember to handle no-trump as well, even though Contract Bridge isn't in the game yet) would help drastically reduce code duplication.

@sunfall sunfall added the cleanup Code cleanup, refactoring, and other tidying. label Aug 23, 2019
@sunfall
Copy link
Owner Author

sunfall commented Aug 23, 2019

Mild investigation results: I did break out handle_trick() before I even put in this FR, and I'm not sure further trick evaluation can be made suitably generic. play(), on the other hand, is essentially identical in all three games. There are a lot of internals that it uses, though, so either those need to be parameterized or the code's gonna get ugly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code cleanup, refactoring, and other tidying.
Projects
None yet
Development

No branches or pull requests

1 participant