cg-core: make cg-shuffle optionally seeded and reproducible
cg-shuffle gains an optional SEED and a `cg-shuffle-seed' dynamic var. With a seed the order is deterministic and identical on every platform, so a deal can be replayed, shared between players, or pinned in a test; the index comes from secure-hash (spec-defined output everywhere, 7 hex digits stay a fixnum even on 32-bit Emacs), so no bignum/overflow behaviour can vary it. With no seed the shuffle is the byte-for-byte old system-random path -- normal play is unchanged. Test cgt-shuffle-seeded pins determinism, permutation, override and a cross-platform golden prefix; fails on the prior one-arg cg-shuffle. Suite 159/159.
This commit is contained in:
parent
1a59003b13
commit
6379127e17
8 changed files with 180 additions and 15 deletions
|
|
@ -1,4 +1,4 @@
|
|||
;;; card-games.el --- Play card games in Emacs (console + SVG) -*- lexical-binding: t; -*-
|
||||
;;; card-games.el --- Play card games (console + SVG) -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2026 Corwin Brust
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue