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/board | |
parent | 6b322dd8ea6e5a636a93be8a643f4c17abe43e90 (diff) | |
download | chessnost-3667da48bfc5c742275cb9d8493242171aab155c.tar.gz |
feat: add "enter move" message
Diffstat (limited to 'src/board')
-rw-r--r-- | src/board/mod.rs | 4 |
1 files changed, 3 insertions, 1 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(); |