feat: demo mode for testing AIs

This commit is contained in:
2025-11-16 20:40:15 -05:00
Unverified
parent ca37c3475c
commit 067f2dbf02
3 changed files with 206 additions and 75 deletions

11
src/random_ai.rs Normal file
View File

@@ -0,0 +1,11 @@
use rand::Rng;
use crate::types::{Client, Color};
pub fn random_move(board: &[Vec<Color>]) -> usize {
let mut random = rand::rng().random_range(0..6);
while board[random][4] != Color::None {
random = rand::rng().random_range(0..6);
}
random
}