Skip to content

A reimplementation of Antony Lee's Redeal in Kotlin.

License

Notifications You must be signed in to change notification settings

phiSgr/rektdeal

Repository files navigation

ReKtDeal

A Kotlin reimplementation of Antony Lee's Redeal,

which is a reimplementation of Thomas Andrews' Deal in Python.

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 - 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 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)
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 can be used.

@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 for how and why it was built.

Talk is cheap. Show me the code.

See a full introduction demo here.

Footnotes

  1. The opening paragraph was adapted from the README of Redeal. The almost identical wording was inspired by some then-recent news.

About

A reimplementation of Antony Lee's Redeal in Kotlin.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published