/*
	cargo test -- --nocapture
*/



/*
	let mut cards : Vec<[&str; 2]> = Vec::new ();
	cards.push (venue_1);
	cards.push (venue_2);
	cards.push (card_1);
	cards.push (card_2);
	cards.push (card_3);

	let longest_straight = crate::deck::longest_straight::obtain (void_deck);
*/

pub mod vow_affirmative_000001;
pub mod vow_affirmative_000002;


/*
	Asks, this should take a flexible
	lenght array of cards.
	
	[   ] Run through the vector
			* 
	
*/
pub fn obtain<'a>(cards: Vec<[&'a str; 2]>) -> i32 {
// pub fn obtain (cards : Vec<[&'static str; 2]>) -> i32 {
	
	
	//
	// the elements start at zero
	//
	//
	let mut vector : Vec<i32> = vec![0; 13];
	
	for card in & cards {
		let talent = card [0];
		
		if (talent == "2") {
			vector [0] += 1;
		}
		else if (talent == "3") {
			vector [1] += 1;
		}
		else if (talent == "4") {
			vector [2] += 1;
		}
		else if (talent == "5") {
			vector [3] += 1;
		}
		else if (talent == "6") {
			vector [4] += 1;
		}
		else if (talent == "7") {
			vector [5] += 1;
		}
		else if (talent == "8") {
			vector [6] += 1;
		}
		else if (talent == "9") {
			vector [7] += 1;
		}
		else if (talent == "T") {
			vector [8] += 1;
		}
		else if (talent == "J") {
			vector [9] += 1;
		}
		else if (talent == "Q") {
			vector [10] += 1;
		}
		else if (talent == "K") {
			vector [11] += 1;
		}
		else if (talent == "A") {
			vector [12] += 1;
		}
		
		//println! ("Card: {:?}", card);
	}
	
	
	// println!("{:?}", vector);
	
	let mut streak = 0;
	let mut longest_streak = 0;
	for value in & vector {
		if (* value >= 1) {
			streak += 1;
		}
		else {
			if (streak >= longest_streak) {
				longest_streak = streak;
			}
			
			streak = 0;
		}
        // println!("{}", value);
    }
	
	if (streak >= longest_streak) {
		longest_streak = streak;
	}
	
	
	return longest_streak;
}