use itertools::Itertools;
use rand::Rng;

const DECK_SIZE: usize = 81;
const NUM_ATTRIBUTES: usize = 4;
const ATTRIBUTES: [&[&str]; NUM_ATTRIBUTES] = [
    &["red", "green", "purple"],
    &["one", "two", "three"],
    &["oval", "squiggle", "diamond"],
    &["solid", "open", "striped"],
];

fn get_random_card_indexes(num_of_cards: usize) -> Vec<usize> {
    let mut selected_cards: Vec<usize> = Vec::with_capacity(num_of_cards);
    let mut rng = rand::thread_rng();
    loop {
        let idx = rng.gen_range(0..DECK_SIZE);
        if!selected_cards.contains(&idx) {
            selected_cards.push(idx);
        }
        if selected_cards.len() == num_of_cards {
            break;
        }
    }

    selected_cards
}

fn run_game(num_of_cards: usize, minimum_number_of_sets: usize) {
    println!(
        "\nGAME: # of cards: {} # of sets: {}",
        num_of_cards, minimum_number_of_sets
    );