Corrected hand evaluator based on Java implementation

This commit is contained in:
Jan-Peter von Hunnius 2025-10-03 21:43:35 +02:00
parent 7ff520ca20
commit e22f2cca0f
9 changed files with 1107 additions and 189 deletions

View file

@ -124,6 +124,12 @@ impl Hand {
Ok(())
}
// Add a card to the hand by its index (0-51)
pub fn add_card_from_index(&mut self, index: u8) -> Result<(), &'static str> {
let card = Card::from_index(index)?;
self.add_card(card)
}
// Remove the last card in the hand
pub fn remove_card(&mut self) {
if self.size > 0 {