-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finished cli with probability function + updated readme
- Loading branch information
Showing
9 changed files
with
828 additions
and
223 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Continuous integration | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.cargo/registry | ||
key: "${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}" | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.cargo/git | ||
key: "${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}" | ||
- uses: actions/cache@v1 | ||
with: | ||
path: target | ||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
|
||
test: | ||
name: Test Suite | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.cargo/registry | ||
key: "${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}" | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.cargo/git | ||
key: "${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}" | ||
- uses: actions/cache@v1 | ||
with: | ||
path: target | ||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
|
||
fmt: | ||
name: Rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- run: rustup component add rustfmt | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
publish: | ||
name: Publish for ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
artifact_name: poker_prob | ||
asset_name: poker-prob-linux-amd64 | ||
- os: windows-latest | ||
artifact_name: poker_prob.exe | ||
asset_name: poker-prob-windows-amd64 | ||
- os: macos-latest | ||
artifact_name: poker_prob | ||
asset_name: poker-prob-macos-amd64 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build | ||
run: cargo build --release | ||
- name: Set outputs | ||
id: vars | ||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | ||
- name: Upload binaries to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.RELEASE_TOKEN }} | ||
file: target/release/${{ matrix.artifact_name }} | ||
asset_name: ${{ matrix.asset_name }} | ||
tag: ${{ steps.vars.outputs.sha_short }} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/doublify/pre-commit-rust | ||
rev: v1.0 | ||
hooks: | ||
- id: fmt | ||
- id: cargo-check |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,37 @@ | ||
# `poker_prob` | ||
|
||
Program to calculate the probabilities of winning hands in rust. This is a work in progress as part of my process to learn rust | ||
Program to calculate the probabilities of winning hands in rust based on rule of 4 and 2 | ||
|
||
## Sample command | ||
cargo run poker_prob -- --ch As10s -n 4 -f 2h5c6d | ||
## Sample commands | ||
|
||
### Help command | ||
|
||
`poker_prob.exe -h` | ||
|
||
Output: | ||
|
||
```/bin/bash | ||
poker_prob.exe [OPTIONS] --mh <STRING> --ch <STRING> | ||
OPTIONS: | ||
-a Set whether this is all in or not | ||
--ch <STRING> Set community cards | ||
-h, --help Print help information | ||
--mh <STRING> Set my hand | ||
-V, --version Print version information | ||
``` | ||
|
||
### Calculate probabilities | ||
|
||
`poker_prob.exe --ch Ad3h --mh 4h3c5c6h -a` | ||
|
||
Output: | ||
|
||
```/bin/bash | ||
Straight has the probability of 8% | ||
Two Pair has the probability of 6% | ||
One Pair has the probability of 0% | ||
Three Of A Kind has the probability of 4% | ||
Flush has the probability of 20% | ||
Full House has the probability of 10% | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.