diff options
author | eug-vs <eugene@eug-vs.xyz> | 2023-01-29 03:59:27 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2023-01-29 04:01:42 +0300 |
commit | 3667da48bfc5c742275cb9d8493242171aab155c (patch) | |
tree | 76e5a9893cd65f471216ceb8b417845708309878 /src | |
parent | 6b322dd8ea6e5a636a93be8a643f4c17abe43e90 (diff) | |
download | chessnost-3667da48bfc5c742275cb9d8493242171aab155c.tar.gz |
feat: add "enter move" message
Diffstat (limited to 'src')
-rw-r--r-- | src/board/mod.rs | 4 | ||||
-rw-r--r-- | src/main.rs | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/board/mod.rs b/src/board/mod.rs index 6df55ab..8f5fbde 100644 --- a/src/board/mod.rs +++ b/src/board/mod.rs @@ -1,4 +1,4 @@ -use std::io::stdin; +use std::io::{stdin, stdout, Write}; use rand::{rngs::StdRng,SeedableRng,Rng}; use crate::{bitboard::{Bitboard, serialize_bitboard, bitscan, pop_count}, moves::{Move, MoveKind}, attacks::Attacks, square::Square}; @@ -148,6 +148,8 @@ impl Board { } pub fn read_move(&self) -> Result<Move, String> { + print!("\nEnter a move: "); + stdout().flush().unwrap(); let mut s = String::new(); stdin().read_line(&mut s).unwrap(); let chars = &mut s.chars(); diff --git a/src/main.rs b/src/main.rs index 7931c63..61f2cd3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,7 +28,7 @@ fn main() { board.print(); println!("Score for {:?} is now: {}", board.color(), board.quiscence(-INFINITY, INFINITY)); - // Simple pondering during opponent time + println!("\nPondering for 3 seconds..."); board.iterative_deepening(5, Duration::from_secs(3)); } } |