mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-07 18:43:26 -08:00
The draw-probability widget computes a hypergeometric probability as a sum of qLn terms. Two argument combinations reach a non-positive term and return NaN, which the results table prints as "nan": - k > K, asking for more copies than the deck holds. A deck with one Forest, draw 7, "exactly 3" gives K=1, k=3. - n - k > N - K, where drawing k targets would need more non-target cards than exist. An 8-card deck with 6 targets, draw 5, "exactly 0" gives N-K=2, n-k=5. Both are reachable: the quantity and drawn spinboxes allow 1-60, and the "at least" branch caps k at copies while the "exactly" branch passes the spinbox value straight through. Extract the function so it can be tested on its own, and guard both cases. Restoring the old guard fails 3 of the 7 new tests. |
||
|---|---|---|
| .. | ||
| resources | ||
| sounds | ||
| src | ||
| themes | ||
| translations | ||
| .qdevelop | ||
| CMakeLists.txt | ||
| cockatrice-cod.xml | ||
| cockatrice.desktop | ||
| cockatrice.qrc | ||
| cockatrice.rc | ||
| cockatrice_en@source.ts | ||