https://github.com/phisgr/rektdeal
A reimplementation of Antony Lee's Redeal in Kotlin.
https://github.com/phisgr/rektdeal
bridge-game
Last synced: 2 months ago
JSON representation
A reimplementation of Antony Lee's Redeal in Kotlin.
- Host: GitHub
- URL: https://github.com/phisgr/rektdeal
- Owner: phiSgr
- License: gpl-3.0
- Created: 2024-01-07T02:08:21.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-08-06T06:26:19.000Z (11 months ago)
- Last Synced: 2025-12-27T01:58:57.381Z (6 months ago)
- Topics: bridge-game
- Language: Kotlin
- Homepage:
- Size: 343 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ReKtDeal
## A Kotlin reimplementation of Antony Lee's Redeal,
### which is a reimplementation of Thomas Andrews' Deal in Python.
[Redeal](https://github.com/anntzer/redeal) is a deal generator:
it outputs deals satisfying whatever conditions you specify -
deals with a double void, deals with a strong 2♣️ opener opposite a yarborough, etc.
Using Bo Haglund's double dummy solver,
it can even solve the hands it has generated for you.
Unfortunately, the language of Redeal - Python - is slow.
ReKtDeal is thus my rewrite of Redeal using another language: Kotlin.[^1]
The deal generation in ReKtDeal is often 100x faster than Redeal,
and that's before multi-threading.
## DDS4J: Double Dummy Solver
Under the hood, ReKtDeal uses [DDS4J](./dds4j) -
Java binding for Bo Haglund’s double dummy solver
(JVM 22+ required).
The binary is bundled for
Windows/Linux x86_64, macOS x86_64/Apple Silicon.
I believe this covers most users.
See the [instructions](./dds4j#custom-binary) if your system is not included.
## Setup
Fundamentally, ReKtDeal is just a Kotlin library.
Using it is no different from any other library from Maven.
E.g. Gradle (Kotlin DSL)
```kotlin
dependencies {
implementation("com.github.phisgr:rektdeal:0.3.0")
}
// Set the JVM args
application {
applicationDefaultJvmArgs = listOf("--enable-native-access=ALL-UNNAMED")
}
```
But I imagine most uses are going to be interactive.
For that [Kotlin Jupyter](https://github.com/Kotlin/kotlin-jupyter) can be used.
```kotlin
@file:DependsOn("com.github.phisgr:rektdeal:0.3.0")
```
## About
The name is pronounced "wrecked deal" - a play on "Redeal" and "kt".
While ReKtDeal largely mirrors the API of Redeal, it departs in philosophy.
Redeal, following Deal, is primarily a command-line program that accepts scripts -
user logic is passed into a main program.
For instance, you can construct an `OpeningLeadSim` in your code,
but to run it you have to invoke `python -mredeal`.
ReKtDeal, on the other hand, is a library.
In your own program or in the REPL,
you call `openingLead` like any other function.
See [this blogpost](https://medium.com/p/957839cac3d4) for how and why it was built.
# Talk is cheap. Show me the code.
See a full introduction demo [here](examples/introduction.ipynb).
[^1]: The opening paragraph was adapted from the [README of Redeal](
https://github.com/anntzer/redeal/blob/main/README.rst).
The almost identical wording was inspired by some then-recent news.