Git Product home page Git Product logo

poker_practice's Introduction

Poker Practice

I have to deal for a poker tournament at my work. I am decent at ranking hands, but I know I am not perfect.

I could not find a good way to practice ranking poker hands. So, I made this tool. It is not perfect, but it is good enough for my needs. Hopefully it can help you too!

How to install

This tool is a python CLI. Download the code, make a virtual environment, install the reqs, and run the code.

There are many ways to do this. One way is:

python -m venv .venv --prompt poker_practice
. .venv/bin/activate
pip install -r requirements.txt
python poker_practice/practice.py

How to use

The tool first takes in a max number of players per hand, 2 to 10 (this seems to be the standard). Enter the number you would like. Each hand will have up to this many players.

How many players max per hand? (2-10): 6

Then, it will deal out a hand. It will ask which player wins, enter the number next to their hand. If multiple players tie, just pick one of them to enter.

Table: [ 2 ♣ ][ 8 ♣ ][ 4 ♣ ][ 2 ♠ ][ 4 ♦ ]
        Player 1: [ 6 ♠ ][ 7 ♦ ]
        Player 2: [ 9 ♦ ][ 5 ♣ ]
        Player 3: [ 2 ♦ ][ 9 ♠ ]
        Player 4: [ 3 ♦ ][ J ♠ ]
        Player 5: [ T ♠ ][ 7 ♠ ]
        Player 6: [ J ♦ ][ 4 ♠ ]

Which player wins? (quit|1-6):

If you were right, it will tell you:

Table: [ 2 ♣ ][ 8 ♣ ][ 4 ♣ ][ 2 ♠ ][ 4 ♦ ]
        Player 1: [ 6 ♠ ][ 7 ♦ ] (Two Pair)
        Player 2: [ 9 ♦ ][ 5 ♣ ] (Two Pair)
        Player 3: [ 2 ♦ ][ 9 ♠ ] (Full House)
        Player 4: [ 3 ♦ ][ J ♠ ] (Two Pair)
        Player 5: [ T ♠ ][ 7 ♠ ] (Two Pair)
        Player 6: [ J ♦ ][ 4 ♠ ] (Full House)

Correct! 6 wins with Full House

Otherwise, it will explain your error:

Table: [ 2 ♣ ][ 8 ♣ ][ 4 ♣ ][ 2 ♠ ][ 4 ♦ ]
        Player 1: [ 6 ♠ ][ 7 ♦ ] (Two Pair)
        Player 2: [ 9 ♦ ][ 5 ♣ ] (Two Pair)
        Player 3: [ 2 ♦ ][ 9 ♠ ] (Full House)
        Player 4: [ 3 ♦ ][ J ♠ ] (Two Pair)
        Player 5: [ T ♠ ][ 7 ♠ ] (Two Pair)
        Player 6: [ J ♦ ][ 4 ♠ ] (Full House)

WRONG! Winner was 6 (Full House), not 4 (Two Pair)

Note, once you guess, the class of each hand is displayed for review.

When you are done, type "quit" for your guess, and the tool will display a summary of the results.

Table: [ 8 ♦ ][ 3 ♦ ][ J ♣ ][ 9 ♣ ][ 4 ♠ ]
        Player 1: [ A ♠ ][ 5 ♦ ]
        Player 2: [ 7 ♦ ][ J ♦ ]
        Player 3: [ 3 ♣ ][ 9 ❤ ]

Which player wins? (quit|1-3): quit
Exiting. Got 1/2 correct.

Good luck!

poker_practice's People

Contributors

cameronlund4 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.