This commit is contained in:
parent
042975e561
commit
3143e5964b
3 changed files with 13 additions and 12 deletions
|
|
@ -4,4 +4,5 @@ version = "0.1.0"
|
|||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
hashbag = "0.1.13"
|
||||
jong-types.workspace = true
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use hashbag::HashBag;
|
||||
use jong_types::*;
|
||||
|
||||
// pub fn check_valid() {}
|
||||
|
||||
pub enum Meldable {
|
||||
Ron,
|
||||
Chii(Tile, Tile),
|
||||
Pon,
|
||||
Kan,
|
||||
|
|
@ -52,17 +52,11 @@ pub fn find_meldables(hand: &[Tile], dealt: Tile) -> Vec<Meldable> {
|
|||
calls.push(Meldable::Chii(prev_outer, prev_inner));
|
||||
}
|
||||
|
||||
// find ron
|
||||
|
||||
calls
|
||||
}
|
||||
|
||||
fn count_shapes(hand: &[Tile]) {
|
||||
let hand = if !hand.is_sorted() {
|
||||
let mut hand = hand.to_vec();
|
||||
hand.sort();
|
||||
&hand
|
||||
} else {
|
||||
hand
|
||||
};
|
||||
pub fn check_ron(hand: &[Tile], melds: &[&[Tile]]) {
|
||||
let bag: HashBag<Tile> = HashBag::from_iter(hand.iter().cloned());
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue