Function twentyone::game::get_hand_value [−][src]
pub fn get_hand_value(hand: &Vec<[char; 2]>, auto_aces: bool) -> u8
Returns the value of a hand
Arguments
hand
- The hand to get the value of
Examples
use twentyone::{cards, game}; let mut deck = cards::create_deck(); cards::shuffle_deck(&mut deck); let mut hand = Vec::new(); cards::hit_card(&mut deck, &mut hand); cards::hit_card(&mut deck, &mut hand); println!("{}", game::get_hand_value(&hand, true));