fix othello player skip logic

This commit is contained in:
2025-02-10 10:23:28 -05:00
parent 3d3eb01143
commit 0bd8dec65d
5 changed files with 18 additions and 7 deletions

View File

@@ -17,10 +17,14 @@ impl Agent for ManualAgent {
fn next_move(&mut self, _: &Board) -> Option<(usize, usize)> {
let stdin = io::stdin();
let mut input = String::new();
println!("Your turn!");
println!("Your turn! ('Skip' to skip)");
loop {
input.clear();
stdin.lock().read_line(&mut input).ok()?;
if input.to_lowercase().trim() == "skip" {
// skips move
return None;
}
let got = input
.split_whitespace()