summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
MA Beaudet [Wed, 10 Nov 2021 20:43:40 +0000 (21:43 +0100)]
refactor(card): add From<Card> for u32
MA Beaudet [Wed, 10 Nov 2021 20:23:53 +0000 (21:23 +0100)]
chore: remove MyError as no longer used
MA Beaudet [Wed, 10 Nov 2021 20:20:35 +0000 (21:20 +0100)]
fix: add some better error handling trying to follow C-WORD-ORDER
MA Beaudet [Wed, 10 Nov 2021 19:51:59 +0000 (20:51 +0100)]
perf(eval): remove unnecessary clones of hands and table
MA Beaudet [Wed, 10 Nov 2021 19:49:54 +0000 (20:49 +0100)]
feat: add conversion AsRef for cards and some delegate methods to cards
MA Beaudet [Wed, 10 Nov 2021 13:24:16 +0000 (14:24 +0100)]
feat: add better error handling for cards (following C-GOOD-ERR)
MA Beaudet [Wed, 10 Nov 2021 11:57:33 +0000 (12:57 +0100)]
feat: add tests verifying C-SEND-SYNC for card and evaluator mods
MA Beaudet [Wed, 10 Nov 2021 11:48:36 +0000 (12:48 +0100)]
feat: apply C-COMMON-TRAITS C-CONV-TRAITS C-COLLECT for Cards and Card
MA Beaudet [Wed, 10 Nov 2021 11:08:41 +0000 (12:08 +0100)]
fix!: change methods `eval_5hand` `eval_7hand` to associated functions
MA Beaudet [Tue, 9 Nov 2021 13:19:04 +0000 (14:19 +0100)]
feat: add ad-hoc conversions conventions for card mod
MA Beaudet [Tue, 9 Nov 2021 12:22:11 +0000 (13:22 +0100)]
refactor: moved wasm feature to wasm32 target build dependencies
MA Beaudet [Tue, 9 Nov 2021 11:18:41 +0000 (12:18 +0100)]
fix: add wasm-bindgen as a feature and rename parallele feature to rayon
MA Beaudet [Tue, 9 Nov 2021 10:52:54 +0000 (11:52 +0100)]
feat: apply C-SERDE to data structures
MA Beaudet [Tue, 9 Nov 2021 10:34:46 +0000 (11:34 +0100)]
fix!: changed random poker-eval's crate feature to rand crate feature
MA Beaudet [Tue, 9 Nov 2021 10:19:44 +0000 (11:19 +0100)]
feat!: remove Rc constraint in Evaluator and add simplification for evals
`cards` and `table` are not Rc anymore, u32 operations are cheap so it
should be ok.
MA Beaudet [Tue, 9 Nov 2021 10:04:19 +0000 (11:04 +0100)]
feat!: apply C-CONV C-GETTER and C-CTOR to card and evaluator
C-CONV recommends accessing inner values with `into_inner`
C-GETTER recommends using `first` instead of `get_first` or `get`
C-CTOR recommends using `with_` for builders, I might create a Dealer
struct that has access to Deck and Rules or simply remove associated
methods in Deck
MA Beaudet [Mon, 8 Nov 2021 17:21:55 +0000 (18:21 +0100)]
fix: change `find_fast` method in Evaluator to private
MA Beaudet [Mon, 8 Nov 2021 17:21:16 +0000 (18:21 +0100)]
test: add test for eval error handling
MA Beaudet [Mon, 8 Nov 2021 17:20:30 +0000 (18:20 +0100)]
feat!: add error handling in eval function
MA Beaudet [Mon, 8 Nov 2021 15:04:53 +0000 (16:04 +0100)]
fix(example): update simulation to reflect changes from previous commit
MA Beaudet [Mon, 8 Nov 2021 15:02:02 +0000 (16:02 +0100)]
feat!(card): Deck methods get get_with.. return Result<Card, MyError>
MA Beaudet [Mon, 8 Nov 2021 14:16:47 +0000 (15:16 +0100)]
fix(card): add error handling of TryFrom<u32> for Card
MA Beaudet [Mon, 8 Nov 2021 13:47:47 +0000 (14:47 +0100)]
chore!: moved card and evaluator to mods
MA Beaudet [Mon, 8 Nov 2021 12:21:40 +0000 (13:21 +0100)]
Merge branch 'deck'
* deck:
feat!: add newtype struct Deck with associated methods
MA Beaudet [Mon, 8 Nov 2021 12:17:23 +0000 (13:17 +0100)]
feat!: add newtype struct Deck with associated methods
Methods associated to Deck `get()` `init_deck()`(changed to Default) and
others have been moved from Cards to newtype struct Deck.
Functions definitions and returned values are also more coherent.
MA Beaudet [Sun, 7 Nov 2021 22:58:45 +0000 (23:58 +0100)]
Merge branch 'hand-struct'
* hand-struct:
feat!: add array ref as args for eval_5hand and eval_7hand
MA Beaudet [Sun, 7 Nov 2021 19:49:07 +0000 (20:49 +0100)]
feat!: add array ref as args for eval_5hand and eval_7hand
eval_5hand now transmutes (unsafe rust) the `&[Card; 5]`. It "should" not
be unsafe as Card has the same repr as u32.
Looking for suggestions on how to convert slice newtype to inner.
MA Beaudet [Sun, 7 Nov 2021 19:49:07 +0000 (20:49 +0100)]
feat!: add bounded slices for eval_5hand and eval_7hand
eval_5hand now transmutes (unsafe rust) the `&[Card; 5]`. It "should" not
be unsafe as Card has the same repr as u32.
Looking for suggestions on how to convert slice newtype to inner.
MA Beaudet [Sun, 7 Nov 2021 19:46:30 +0000 (20:46 +0100)]
fix: remove unnecessary try_from conversions from Card to u32
MA Beaudet [Sun, 7 Nov 2021 19:45:12 +0000 (20:45 +0100)]
feat: add From<Cards> for Vec<u32> and transparent repr for Card
MA Beaudet [Sun, 7 Nov 2021 19:32:32 +0000 (20:32 +0100)]
fix!: removen in Cards struct renamed to get
MA Beaudet [Sat, 6 Nov 2021 16:23:36 +0000 (17:23 +0100)]
feat!: add Card(u32) newtype and Hand changed to Cards(Vec<Card>) newtype
`Hand` struct changed from Hand { cards } to newtype Cards(Vec<Card>)
Cards and Card both implement std::str::FromStr and std::fmt::Display.
Card implements TryForm<u32> PartialEq and PartialOrd (compares ranks)
Card provides get(), suit() and rank() methods, mostly helpers for
std::fmt::Display
Cards now implements init_deck(), shuffle_cards() and removen(name might
change)
Simulation example updated
MA Beaudet [Sat, 6 Nov 2021 12:16:05 +0000 (13:16 +0100)]
feat: add simulation example
MA Beaudet [Sat, 6 Nov 2021 12:02:18 +0000 (13:02 +0100)]
feat: add evaluator and hand structs (WIP)
Evaluation should be done using these structs. I will probably let some
functions available freely for wasm builds.
Hand should probably be changed to `struct Hand(Vec<Card>) where Card is
`struct Card(u32)` that impl `std::str::FromStr`, `std::fmt::Display`,
PartialEq`, `PartialOrd` and others...
MA Beaudet [Fri, 5 Nov 2021 14:50:11 +0000 (15:50 +0100)]
feat(web): add frequency, parse_cards and eval_hand functions
Does not use deprecated `eval_from_str` exported wasm functions anymore.
Updated the wasm_bindgen generated files
MA Beaudet [Fri, 5 Nov 2021 14:45:59 +0000 (15:45 +0100)]
feat(web): add warning handling for faillible wasm functions
MA Beaudet [Fri, 5 Nov 2021 14:42:13 +0000 (15:42 +0100)]
feat: add frequency function and constants
`frequency` is available through wasm_bindgen.
MA Beaudet [Fri, 5 Nov 2021 14:37:28 +0000 (15:37 +0100)]
feat: eval_from_str split in two functions
`eval_from_str` was doing too much. Now `parse_cards` parses the cards
and `eval_hand` wraps over `eval_5hand` and `eval_7hand`.
Both functions are available through wasm_bindgen
MA Beaudet [Fri, 5 Nov 2021 14:33:12 +0000 (15:33 +0100)]
fix: parsing a card now returns an option
`card_from_str` is renamed to `parse_card` and now returns an
`Option<u32>` instead of a `u32`. The function does not panic anymore.
MA Beaudet [Fri, 5 Nov 2021 10:05:03 +0000 (11:05 +0100)]
chore(web): remove comments from index.js
MA Beaudet [Fri, 5 Nov 2021 09:59:11 +0000 (10:59 +0100)]
fix: convert unnecessary u32 to u16 and u8
Debug builds are now 2x faster, release builds were already optimized
MA Beaudet [Fri, 5 Nov 2021 08:32:21 +0000 (09:32 +0100)]
refactor: main now in examples
MA Beaudet [Thu, 4 Nov 2021 18:01:23 +0000 (19:01 +0100)]
feat(web): update html and css for lighthouse performance
MA Beaudet [Thu, 4 Nov 2021 16:24:57 +0000 (17:24 +0100)]
feat(wasm): add wasm js generated files and basic web example
MA Beaudet [Wed, 3 Nov 2021 22:26:22 +0000 (23:26 +0100)]
Merge branch 'main' of mars:/srv/git/poker-eval
* 'main' of mars:/srv/git/poker-eval:
feat: add wasm-bindgen build option and live example
MA Beaudet [Wed, 3 Nov 2021 21:34:36 +0000 (22:34 +0100)]
feat: add wasm-bindgen build option and live example
Pass Automated Testing Suite [Wed, 3 Nov 2021 21:34:36 +0000 (22:34 +0100)]
feat: add wasm-bindgen build option and live example
Pass Automated Testing Suite [Wed, 3 Nov 2021 08:52:16 +0000 (09:52 +0100)]
initial commit