Assignment 12 Done

This commit is contained in:
static
2024-12-16 21:24:26 +00:00
parent 22a78bf662
commit 41a9c71fbc

View File

@@ -45,6 +45,20 @@ impl Player {
/// This function should return the index of the card to flip and the color to change to.
pub fn flip_card_strategy(&mut self) -> (usize, Color) {
todo!()
let dist = 400;
let counter_entry = self.memory.entry(0).or_insert(0);
if *counter_entry % dist % 4 == 0 {
*counter_entry += 1;
}
let index = (*counter_entry % 25) * dist + (*counter_entry / 25);
*counter_entry += 1;
if *counter_entry == 10000 {
*counter_entry = 0;
}
(index as usize, Color::White)
}
}