ddsWrapper 1.0.151

There is a newer version of this package available.
See the version list below for details.
dotnet add package ddsWrapper --version 1.0.151
                    
NuGet\Install-Package ddsWrapper -Version 1.0.151
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ddsWrapper" Version="1.0.151" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ddsWrapper" Version="1.0.151" />
                    
Directory.Packages.props
<PackageReference Include="ddsWrapper" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ddsWrapper --version 1.0.151
                    
#r "nuget: ddsWrapper, 1.0.151"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ddsWrapper@1.0.151
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ddsWrapper&version=1.0.151
                    
Install as a Cake Addin
#tool nuget:?package=ddsWrapper&version=1.0.151
                    
Install as a Cake Tool

ddsWrapper

A .NET wrapper for double-dummy bridge solvers, bundling two native engines:

  • DDS — Bo Haglund's battle-tested double-dummy solver.
  • bridge-solver — a modern Rust-based solver with card-by-card play analysis and claim checking.

Deals are expressed in PBN format, e.g.:

N:AKQT3.J6.KJ42.95 652.AK42.AQ87.T4 J74.QT95.T.AK863 98.873.9653.QJ72

Requirements

  • Windows x64
  • .NET 10 or later
  • The Visual C++ Redistributable (MSVC runtime) must be installed, as bridgesolver.dll and dds.dll depend on it.

Installation

dotnet add package ddsWrapper

Both native DLLs (dds.dll and bridgesolver.dll) are automatically copied to your output directory on build.


Usage

DDS — Double-Dummy Solver

Wraps dds.dll for high-performance, multi-threaded double-dummy analysis.

using DDS;

// Solve a single board: which cards can be played and how many tricks does each score?
var state = new GameState(...);
List<CardPotential> cards = ddsWrapper.BestCards(state);

// Full double-dummy table: tricks for every seat × strain combination
TableResults table = ddsWrapper.CalcDDtable(deal);
byte tricksNorthSpades = table[Seats.North, Suits.Spades];

BridgeSolverWrapper — bridge-solver

Wraps bridgesolver.dll for double-dummy tables, card-by-card play analysis, and claim checking.

Library version
using BridgeSolver;

string version = BridgeSolverWrapper.GetVersion(); // e.g. "2.0.0"
Double-dummy table

Returns trick counts for all 20 seat × strain combinations.

string deal = "N:AKQT3.J6.KJ42.95 652.AK42.AQ87.T4 J74.QT95.T.AK863 98.873.9653.QJ72";
TableResults tricks = BridgeSolverWrapper.DdTableTricks(deal);

byte northInSpades = tricks[Seats.North, Suits.Spades];
Batch double-dummy analysis

Solve up to 1,000 deals in parallel, returning only deals where at least one contract is makeable.

List<Deal> deals = ...; // up to 1000 deals
TableResults needed = ...; // which suits to evaluate (0 = skip, 1 = evaluate)

List<TableResults> results = BridgeSolverWrapper.PossibleTricks(deals, needed, maxDuration: 5);
Card-by-card play analysis

Evaluate which of a set of candidate cards gives the best outcome for declarer.

GameState state = ...;
List<Bridge.Card> candidates = ...;

List<CardPotential> best = BridgeSolverWrapper.BestCards(state, candidates);
Stateful play analysis with Analyzer

Analyzer maintains state across cards played in the same deal. Dispose when done.

using var analyzer = new BridgeSolverWrapper.Analyzer();

string requestJson = """
    {
        "dealstr": "N:AKQT3.J6.KJ42.95 652.AK42.AQ87.T4 J74.QT95.T.AK863 98.873.9653.QJ72",
        "trump": "S",
        "declarer": "N",
        "leader": "E",
        "plays": ["C2"]
    }
    """;

string responseJson = analyzer.Play(requestJson);
// {"contract_tricks": 10, ...}

Conventions

Concept Values
Strains "C", "D", "H", "S", "NT"
Seats "N", "E", "S", "W"
Vulnerable "None", "NS", "EW", "All"
Deal format PBN, e.g. "N:AK.... ..."

Trick counts in TableResults are indexed as [seat, strain] using the Seats and Suits enums, with seats N=0, E=1, S=2, W=3 and strains C=0, D=1, H=2, S=3, NT=4.


Native DLLs

File Source Licence
dds.dll dds-bridge/dds Apache-2.0
bridgesolver.dll bridge-craftwork/bridge-solver MIT OR Apache-2.0

Third-party notices for bridgesolver.dll are included in bridge-solver/THIRD-PARTY-NOTICES.


Licence

MIT OR Apache-2.0 — see repository for details.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.158 106 11/27/2026
1.0.157 107 11/26/2026
1.0.156 97 11/25/2026
1.0.155 97 11/25/2026
1.0.153 103 11/25/2026
1.0.152 104 11/24/2026
1.0.151 100 11/24/2026
1.0.148 100 11/23/2026
1.0.147 109 11/10/2026
1.0.144 106 11/10/2026
1.0.139 101 11/8/2026
1.0.138 92 11/8/2026
1.0.137 106 11/8/2026
1.0.136 98 11/8/2026
1.0.135 103 11/8/2026
1.0.134 98 11/8/2026
1.0.133 104 11/8/2026
1.0.132 93 11/8/2026
1.0.129 98 11/8/2026
1.0.121 131 10/12/2026
Loading failed