poker-eval.git
3 years agofeat: add From<Cards> for Vec<u32> and transparent repr for Card
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

3 years agofix!: removen in Cards struct renamed to get
MA Beaudet [Sun, 7 Nov 2021 19:32:32 +0000 (20:32 +0100)]
fix!: removen in Cards struct renamed to get

3 years agofeat!: add Card(u32) newtype and Hand changed to Cards(Vec<Card>) newtype
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

3 years agofeat: add simulation example
MA Beaudet [Sat, 6 Nov 2021 12:16:05 +0000 (13:16 +0100)]
feat: add simulation example

3 years agofeat: add evaluator and hand structs (WIP)
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...

3 years agofeat(web): add frequency, parse_cards and eval_hand functions
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

3 years agofeat(web): add warning handling for faillible wasm functions
MA Beaudet [Fri, 5 Nov 2021 14:45:59 +0000 (15:45 +0100)]
feat(web): add warning handling for faillible wasm functions

3 years agofeat: add frequency function and constants
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.

3 years agofeat: eval_from_str split in two functions
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

3 years agofix: parsing a card now returns an option
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.

3 years agochore(web): remove comments from index.js
MA Beaudet [Fri, 5 Nov 2021 10:05:03 +0000 (11:05 +0100)]
chore(web): remove comments from index.js

3 years agofix: convert unnecessary u32 to u16 and u8
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

3 years agorefactor: main now in examples
MA Beaudet [Fri, 5 Nov 2021 08:32:21 +0000 (09:32 +0100)]
refactor: main now in examples

3 years agofeat(web): update html and css for lighthouse performance
MA Beaudet [Thu, 4 Nov 2021 18:01:23 +0000 (19:01 +0100)]
feat(web): update html and css for lighthouse performance

3 years agofeat(wasm): add wasm js generated files and basic web example
MA Beaudet [Thu, 4 Nov 2021 16:24:57 +0000 (17:24 +0100)]
feat(wasm): add wasm js generated files and basic web example

3 years agoMerge branch 'main' of mars:/srv/git/poker-eval
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

3 years agofeat: 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

3 years agofeat: 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

3 years agoinitial commit
Pass Automated Testing Suite [Wed, 3 Nov 2021 08:52:16 +0000 (09:52 +0100)]
initial commit