fn card_to_value(card: Card) -> usize {

    let value = 4*match card.value {
        Value::Two => 0,
        Value::Three => 1,
        Value::Four => 2,
        Value::Five => 3,
        Value::Six => 4,
        Value::Seven => 5,
        Value::Eight => 6,
        Value::Nine => 7,
        Value::Ten => 8,
        Value::Jack => 9,
        Value::Queen => 10,
        Value::King => 11,
        Value::Ace => 12,
    };
    let suit = match card.suit {
        Suit::Hearts => 0,
        Suit::Spades => 1,
        Suit::Diamonds => 2,
        Suit::Clubs => 3,
    };

    suit + value
}
// translates a card to a value between 0 and 51 inclusive
translates a card to a value between 0 and 51 inclusive
translates a card to a value between 0 and 51 inclusive
fn card_to_value(card: Card) -> usize {
    let value = 4*match card.value {
        Value::Two => 0,
        Value::Three => 1,
        Value::Four => 2,
        Value::Five => 3,
        Value::Six => 4,
        Value::Seven => 5,
        Value::Eight => 6,
        Value::Nine => 7,
        Value::Ten => 8,
        Value::Jack => 9,
        Value::Queen => 10,
        Value::King => 11,
        Value::Ace => 12,
    };
    let suit = match card.suit {
        Suit::Hearts => 0,
        Suit::Spades => 1,
        Suit::Diamonds => 2,
        Suit::Clubs => 3,
    };
    suit + value
}
fn card_to_value ( card : Card ) -> usize { let value = 4 * match card . value { Value :: Two => 0 , Value :: Three => 1 , Value :: Four => 2 , Value :: Five => 3 , Value :: Six => 4 , Value :: Seven => 5 , Value :: Eight => 6 , Value :: Nine => 7 , Value :: Ten => 8 , Value :: Jack => 9 , Value :: Queen => 10 , Value :: King => 11 , Value :: Ace => 12 , } ; let suit = match card . suit { Suit :: Hearts => 0 , Suit :: Spades => 1 , Suit :: Diamonds => 2 , Suit :: Clubs => 3 , } ; suit + value }
translates a card to a value between 0 and 51 inclusive
translates a card to a value between 0 and 51 inclusive
card
Card
card
Card