Crates.io | bridgitte |
lib.rs | bridgitte |
version | 0.1.3 |
created_at | 2024-11-28 16:16:21.832417+00 |
updated_at | 2024-11-28 16:25:50.561367+00 |
description | Contract bridge double dummy solver |
homepage | |
repository | |
max_upload_size | |
id | 1464675 |
size | 199,702 |
Bridgitte is a contract bridge double dummy solver written in Rust. It was written for (personal) education to explore representing card sets as 64-bit masks.
cargo +nightly install bridgitte
You can use bridgitte to fully analyze the deal:
$ bridgitte analyze-deal "854.Q873.Q984.65 KQ32.T6.T72.AJ93 9.AJ542.J653.T87 AJT76.K9.AK.KQ42"
♠ KQ32
♥ T6
♦ T72
♣ AJ93
♠ 854 ♠ 9
♥ Q873 ♥ AJ542
♦ Q984 ♦ J653
♣ 65 ♣ T87
♠ AJT76
♥ K9
♦ AK
♣ KQ42
♣ ♦ ♥ ♠ N
W 1 6 7 1 1
N 12 6 6 12 12
E 1 6 7 1 1
S 12 6 6 12 12
When limited to a declarer+strain bridgitte will give a winning play:
$ bridgitte analyze-deal --declarer N --strain S '854.Q873.Q984.65 KQ32.T6.T72.AJ93 9.AJ542.J653.T87 AJT76.K9.AK.KQ42'`
♠ KQ32
♥ T6
♦ T72
♣ AJ93
♠ 854 ♠ 9
♥ Q873 ♥ AJ542
♦ Q984 ♦ J653
♣ 65 ♣ T87
♠ AJT76
♥ K9
♦ AK
♣ KQ42
♠
N 12
W N E S
1 E 🂨 🂭 🂩 🂡
2 S 🂤 🂮 🂱 🂦
3 N 🂥 🂢 🂻 🂧
4 S 🂷 🂣 🂴 🂪
5 S 🂸 🂺 🂵 🂫
6 S 🂳 🂶 🂲 🂾
7 S 🂽 🃊 🃋 🂹
8 W 🃈 🃇 🃅 🃎
9 S 🃉 🃂 🃆 🃁
10 S 🃕 🃑 🃚 🃝
11 N 🃖 🃙 🃗 🃞
12 S 🃄 🃛 🃘 🃔
13 N 🃍 🃓 🃃 🃒
Search algorithm is straightforward Zero-Window Partitioned Search.
Important details:
As of Nov 2024 bridgitte is ~100 time slower than state of the art. It takes seconds to evaluate "fast" positions and minutes for "slow" ones.
The following algorithm improvements will probably speed things up:
Contributions are welcome. Just open a PR.