/// translates a value between 0 and 51 to a Card. Used internally.
translates a value between 0 and 51 to a Card. Used internally.
translates a value between 0 and 51 to a Card . Used internally .
fn create_card_for_value(value: u8) -> Card {
    let suit = match value/13 {
        0 => Suit::Spades,
        1 => Suit::Hearts,
        2 => Suit::Diamonds,
        3 => Suit::Clubs,
        _ => panic!("Unexpected suit conversion number")
    };
    let value = match value%13 {
        0 => Value::Two,
        1 => Value::Three,
        2 => Value::Four,
        3 => Value::Five,
        4 => Value::Six,
        5 => Value::Seven,
        6 => Value::Eight,
        7 => Value::Nine,
        8 => Value::Ten,
        9 => Value::Jack,
        10 => Value::Queen,
        11 => Value::King,
        12 => Value::Ace,
        _ => panic!("Unexpected value conversion number")
    };
    Card::new(value, suit)
}
fn create_card_for_value ( value : u8 ) -> Card { let suit = match value / 13 { 0 => Suit :: Spades , 1 => Suit :: Hearts , 2 => Suit :: Diamonds , 3 => Suit :: Clubs , _ => panic ! ( " " ) } ; let value = match value % 13 { 0 => Value :: Two , 1 => Value :: Three , 2 => Value :: Four , 3 => Value :: Five , 4 => Value :: Six , 5 => Value :: Seven , 6 => Value :: Eight , 7 => Value :: Nine , 8 => Value :: Ten , 9 => Value :: Jack , 10 => Value :: Queen , 11 => Value :: King , 12 => Value :: Ace , _ => panic ! ( " " ) } ; Card :: new ( value , suit ) }
translates a value between 0 and 51 to a Card.
translates a value between 0 and 51 to a Card .
value
u8