Skip to content

Commit

Permalink
Format markdown files
Browse files Browse the repository at this point in the history
  • Loading branch information
azriel1rf committed May 4, 2024
1 parent 1bc79a2 commit 09579c9
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 28 deletions.
33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ as Omaha poker hands evaluation.

You can install the library using `pip`:

```
```sh
pip3 install phevaluator
```

Expand All @@ -129,31 +129,39 @@ and [bensi94](https://github.com/bensi94).

## Other Implementations

[PHE](https://github.com/thlorenz/phe) is a Javascript port, developed by Thorsten Lorenz.
[PHE](https://github.com/thlorenz/phe) is a Javascript port, developed by Thorsten
Lorenz.

[41Poker](https://github.com/41semicolon/41poker) is another Javascript port, developed by 41semicolon.
[41Poker](https://github.com/41semicolon/41poker) is another Javascript port,
developed by 41semicolon.

[poker](https://pub.dev/packages/poker) is a Dart port, developed by Kohei.

[ghais/poker](https://github.com/ghais/poker/blob/main/src/Poker/Holdem/Evaluate.hs) contains a Haskell implementation of the evaluator.
[ghais/poker](https://github.com/ghais/poker/blob/main/src/Poker/Holdem/Evaluate.hs)
contains a Haskell implementation of the evaluator.

[gophe](https://github.com/mattlangl/gophe) is a Go port, developed by mattlangl.

[poker-handle](https://github.com/pocketberserker/poker-handle/tree/main/src/poker) has a TypeScript port, developed by pocketberserker.
[poker-handle](https://github.com/pocketberserker/poker-handle/tree/main/src/poker)
has a TypeScript port, developed by pocketberserker.

[PokerHandEvaluator.cs](https://github.com/travisstaloch/PokerHandEvaluator.cs) is a C# port, developed by travisstaloch.
[PokerHandEvaluator.cs](https://github.com/travisstaloch/PokerHandEvaluator.cs)
is a C# port, developed by travisstaloch.

[poker_engine](https://github.com/aleo101/poker_engine) is a Rust port, developed by Alexander Leones.
[poker_engine](https://github.com/aleo101/poker_engine) is a Rust port,
developed by Alexander Leones.

[Poker-Calculator](https://github.com/tryabin/Poker-Calculator) contains a CUDA implementation of this evaluator.
[Poker-Calculator](https://github.com/tryabin/Poker-Calculator) contains a CUDA
implementation of this evaluator.

## Awesome Use Cases

### A simple Hold'em pre-flop equity estimator

A reddit user coded a Hold'em pre-flop equity estimator in C++ using the PHEvaluator library.
A reddit user coded a Hold'em pre-flop equity estimator in C++ using the
PHEvaluator library.

https://www.reddit.com/r/poker/comments/okk5qn/i_ran_1m_runouts_of_random_play_to_get_a_sense_of/
<https://www.reddit.com/r/poker/comments/okk5qn/i_ran_1m_runouts_of_random_play_to_get_a_sense_of/>

The source code can be found in [sim.cc](https://gist.github.com/bwasti/c2ca972c57f4fb581813f82f010c7cb2).

Expand All @@ -165,10 +173,11 @@ An article about Monte Carlo simulation of Texas Hold'em.

[Estimating the outcome of a Texas hold’em game using Monte Carlo simulation](https://petrosdemetrakopoulos.medium.com/estimating-the-outcome-of-a-texas-holdem-game-using-monte-carlo-simulation-1be35be29036)

It's source code is in https://github.com/petrosDemetrakopoulos/TexasHoldemMonteCarloSimulation
It's source code is in <https://github.com/petrosDemetrakopoulos/TexasHoldemMonteCarloSimulation>

## Contributing to this repository

All contributions are welcome. A contribution can be as small as reporting a bug by creating an issue.
All contributions are welcome. A contribution can be as small as reporting a bug
by creating an issue.

If you plan to create a Pull Request, please find more details in [CONTRIBUTING.md](CONTRIBUTING.md).
21 changes: 11 additions & 10 deletions cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
The following intructions assumes you are in the [cpp](/cpp/) directory. If
you are in the root directory, please change to [cpp](/cpp/) first.

```
```sh
cd cpp
```

### Build with CMake

This library can be built using CMake. A recommended way of building it is:

```
```sh
mkdir -p build
cd build
cmake ..
Expand All @@ -25,14 +25,14 @@ a unit test binary `unit_tests`.

Run `unit_tests` to perform the unit tests:

```
```sh
./unit_tests
```

Another build option is to build the library only, after generating the CMake files,
run `make pheval` to build the static-linked library.

```
```sh
mkdir -p build
cd build
cmake ..
Expand All @@ -44,7 +44,7 @@ make pheval
The unit tests depends on Google Test suite, which isn't available in Windows.
This way allows us to build the libraries and examples.

```
```sh
mkdir -p build
cd build
cmake -DBUILD_TESTS=OFF ..
Expand All @@ -55,15 +55,15 @@ After successfully running the `cmake` command, each build target will generate

### Build with GNU Make

This [cpp](/cpp/) directory also includes a Makefile, for users that want to use native
GNU Make to compile the library.
This [cpp](/cpp/) directory also includes a Makefile, for users that want to use
native GNU Make to compile the library.

Simply run `make` to build the static-linked library `libpheval.a`.

In the [examples](/cpp/examples), there is another Makefile to compile the examples
with the library linked.

```
```sh
cd examples
make
```
Expand All @@ -72,7 +72,7 @@ make

After running `make`, you can see the following library files generated:

```
```text
libpheval.a # library pheval
libpheval5.a # library pheval5
libpheval6.a # library pheval6
Expand All @@ -82,7 +82,7 @@ libphevalplo5.a # library phevalplo5
libphevalplo6.a # library phevalplo6
```

#### pheval
### pheval

The corresponding library file is `libpheval.a`.

Expand Down Expand Up @@ -318,6 +318,7 @@ describe_rank(rank2); // Nines Full over Fours
```
<a name="cardid"></a>
## Card Id
We can use an integer to represent a card. The two least significant bits
Expand Down
14 changes: 8 additions & 6 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# Test Data

Each directory has two sets of test data, both in csv format. The last column of each line
represents the rank of the test case, and the other columns are the card input.
Each directory has two sets of test data, both in csv format. The last column of
each line represents the rank of the test case, and the other columns are the
card input.

In the `string_input_tests.csv` files, the card inputs are using string format, while in the
`id_input_tests.csv` files, the inputs are [Card Id](../cpp/#cardid) format.
In the `string_input_tests.csv` files, the card inputs are using string format,
while in the `id_input_tests.csv` files, the inputs are [Card Id](../cpp/#cardid)
format.

For example, if we look at the file `five/string_input_tests.csv`, it has six columns.
The first five columns are the five different cards, and the last column is the rank of the
given five cards.
The first five columns are the five different cards, and the last column is the
rank of the given five cards.

```bash
card_1,card_2,card_3,card_4,card_5,rank
Expand Down

0 comments on commit 09579c9

Please sign in to comment.