Aryadev Chavali
c39d6afd89
modes:pair:tests: footstool implemented
2026-04-05 04:45:51 +01:00
Aryadev Chavali
83ab81a569
modes:pair:tests: ordering implemented
2026-04-05 04:45:51 +01:00
Aryadev Chavali
555b82d671
modes:pair:tests: refactor exhaustive_deck
2026-04-05 04:45:51 +01:00
Aryadev Chavali
8a2cbf1bc9
modes:pair:ord: Remove useless case
2026-04-05 04:45:51 +01:00
Aryadev Chavali
2d179f0316
modes:single: make Single::new public
2026-04-05 04:45:51 +01:00
Aryadev Chavali
11d5149d35
modes:single:tests: refactor make_deck uses
2026-04-05 04:45:51 +01:00
Aryadev Chavali
d9cc67d3d1
modes:single:tests: refactor
2026-04-05 04:45:51 +01:00
Aryadev Chavali
e035f53234
modes:pair: refactor tests to utilise Rank::iter_all and Rank::cards
2026-04-05 04:45:51 +01:00
Aryadev Chavali
6119410496
card: new -> make_joker and make_playing-card
...
Always better to be explicit with our constructor names.
2026-04-05 04:45:51 +01:00
Aryadev Chavali
f40596bc1d
modes:pair:tests: implement test::new
2026-04-05 04:45:51 +01:00
Aryadev Chavali
cb2c220a5b
modes:pair:tests:exhaustive_pairs: refactor for accuracy
2026-04-05 04:45:51 +01:00
Aryadev Chavali
e9c37d49e3
modes:pair:ord: make improper pairs worse than proper pairs
...
If the highcard of two pairs are equivalent, but one is improper while
the other is proper, the proper pair is always greater.
2026-04-05 04:45:51 +01:00
Aryadev Chavali
40046fa98c
modes:single:tests: Full stops on // TEST comments.
2026-04-05 04:45:51 +01:00
Aryadev Chavali
27f9f79416
modes:mod:Hand: is_proper and is_improper indicator functions
...
A "proper" hand is one that has no wild cards - an "improper" hand is
one that does have at least one wild card.
~is_proper~ should be implemented for any Hand - ~is_improper~ falls
out for free.
Implemented for Single and Pair.
2026-04-05 04:45:51 +01:00
Aryadev Chavali
b76ad869ea
modes:single:tests: commentary, reflexive testing on differing decks
2026-04-05 04:45:51 +01:00
Aryadev Chavali
534da2ed71
modes:pair: test skeletons for pairs.
2026-04-05 04:45:51 +01:00
Aryadev Chavali
994ebea678
modes:single: rename some tests
2026-04-05 04:45:51 +01:00
Aryadev Chavali
6a86f7d62b
modes:single|pair: Use square brackets instead of braces for display
...
Helps distinguish from the Debug print.
2026-04-05 04:45:51 +01:00
Aryadev Chavali
30a7c466e5
modes:pair: Implement Hand for Pair
...
The footstool condition here is super simple since we just utilise the
Single footstool condition against Pair::1 of both pairs.
2026-04-05 04:45:51 +01:00
Aryadev Chavali
0328a828c8
modes:pair: document that Pair::1 is always a playing card in Pair::new
2026-04-05 04:45:51 +01:00
Aryadev Chavali
0267a6f567
modes:pair: adjust Ord impl for Pair
...
Instead of doing a deep-check where we compare their best member
before their worst member, we just compare by the best member.
This allows (Joker, 4S) to be equal to (4C, 4S).
2026-04-05 04:45:51 +01:00
Aryadev Chavali
a24d85572d
modes:single|pair: make fields of Single and Pair public
...
So strange that this isn't default for tuple-like constructors. I can
kinda get it for record-like constructors, but not for this. Better
safe than sorry I guess?
2026-04-05 04:45:51 +01:00
Aryadev Chavali
5ef0b7e58a
modes:pair: implement Eq and Ord for Pair
...
If we auto-derived Ord it would look at Pair::0 first, when it should
look at Pair::1. Hence the custom implementation.
2026-04-05 04:45:51 +01:00
Aryadev Chavali
599fb44edb
modes:pair: implement Display for Pair
2026-04-05 04:45:51 +01:00
Aryadev Chavali
da60b41b97
modes:*: doc strings
2026-04-05 04:45:51 +01:00
Aryadev Chavali
439b787040
modes:pair: add doc string for Pair::new
2026-04-05 04:45:51 +01:00
Aryadev Chavali
fea8f1716d
*: fix doc strings
2026-04-05 04:45:51 +01:00
Aryadev Chavali
e1db8af26c
modes:pair: Added pair type
...
Slightly more complex pattern since we've got two cards, but still
relatively trivial.
2026-04-05 04:45:51 +01:00
Aryadev Chavali
f5fa964e55
modes:mod: use matches! instead of assert!(match...)
...
Give it up for Clippy, MVP of this codebase.
2026-04-05 04:45:51 +01:00
Aryadev Chavali
71f644043a
modes:mod|single: fix issue with footstool not taking other by reference
2026-04-05 04:45:51 +01:00
Aryadev Chavali
e401819914
modes:mod: doc for test_non_reflexivity
2026-04-05 04:45:51 +01:00
Aryadev Chavali
e46ece2622
modes:singles: refactor tests using the generic non_reflexive test.
2026-04-05 04:45:51 +01:00
Aryadev Chavali
bcd38ecdc4
modes:mod: implemented a generic tester for non_reflexivity
...
Given two "Hands", we test that the footstool condition on those two
hands are non-reflexive.
2026-04-05 04:45:51 +01:00
Aryadev Chavali
9c5ee74639
modes:single: tests for footstooling and invalid singles
2026-04-05 04:45:51 +01:00
Aryadev Chavali
d2075cd000
modes:single: implement Hand for Singles
...
Really trivial implementation.
2026-04-05 04:45:51 +01:00
Aryadev Chavali
44d8e4eba0
modes:mod: Hand trait
...
Any hand from any round mode has a chance of footstooling another hand
from that same mode. This trait (Hand) allows us to implement these
semantics (as well as any other shared semantics) for each round mode.
2026-04-05 04:45:51 +01:00
Aryadev Chavali
ca07536b37
modes: new crate representing the API for different round types
...
Single is our first one - trivial really. Only thing we need to check
is that the single isn't made up of a joker.
2026-04-05 04:45:51 +01:00