fix othello player skip logic
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user