This commit is contained in:
Tao Tien 2026-02-14 20:05:04 -08:00
parent 042975e561
commit 3143e5964b
3 changed files with 13 additions and 12 deletions

View file

@ -4,4 +4,5 @@ version = "0.1.0"
edition = "2024"
[dependencies]
hashbag = "0.1.13"
jong-types.workspace = true

View file

@ -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());
}