this needed to stop

This commit is contained in:
LinlyBoi
2023-05-10 08:53:25 +03:00
parent 69dfe217d6
commit a6072f8b5f

View File

@@ -34,6 +34,9 @@ impl Board {
(self.p1_score, self.p2_score) (self.p1_score, self.p2_score)
} }
pub fn play(&mut self, disk: Disk, col: usize) -> bool { pub fn play(&mut self, disk: Disk, col: usize) -> bool {
if self.game_over() {
return false;
}
let column = &self.columns.as_columns()[col]; let column = &self.columns.as_columns()[col];
let empty = column.iter().filter(|&a| matches!(a, Disk::EMPTY)).count(); let empty = column.iter().filter(|&a| matches!(a, Disk::EMPTY)).count();
// dbg!(empty); // dbg!(empty);