From 3667da48bfc5c742275cb9d8493242171aab155c Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 29 Jan 2023 03:59:27 +0300 Subject: feat: add "enter move" message --- src/board/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/board/mod.rs') 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 { + print!("\nEnter a move: "); + stdout().flush().unwrap(); let mut s = String::new(); stdin().read_line(&mut s).unwrap(); let chars = &mut s.chars(); -- cgit v1.2.3