Refactor the game flow and support splits

Behaves more like a client/server, rather than just taking a decision
function. The CLI logic is more complex now, but the game is more
flexible and and support splits (basically branching the hand off)
This commit is contained in:
Nick Pegg 2025-07-09 12:30:37 -07:00
parent cb70077f5a
commit 69a4239f90
8 changed files with 820 additions and 334 deletions

28
Cargo.lock generated
View file

@ -52,6 +52,12 @@ dependencies = [
"windows-sys 0.59.0",
]
[[package]]
name = "anyhow"
version = "1.0.98"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
[[package]]
name = "bitflags"
version = "2.9.1"
@ -62,10 +68,12 @@ checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967"
name = "blackjack"
version = "0.1.0"
dependencies = [
"anyhow",
"clap",
"console",
"itertools",
"rand",
"thiserror",
]
[[package]]
@ -275,6 +283,26 @@ dependencies = [
"unicode-ident",
]
[[package]]
name = "thiserror"
version = "2.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "2.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "unicode-ident"
version = "1.0.18"