From 10a68da1249931a6220ca06affa063c187836bbd Mon Sep 17 00:00:00 2001 From: eug-vs Date: Fri, 24 Feb 2023 17:35:35 +0300 Subject: feat: add initial multi-threaded UCI impl --- src/moves.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/moves.rs') diff --git a/src/moves.rs b/src/moves.rs index e27d74c..3cf9fd3 100644 --- a/src/moves.rs +++ b/src/moves.rs @@ -1,3 +1,5 @@ +use std::str::Chars; + use crate::{square::Square, bitboard::BitboardFns, board::piece::Piece}; #[derive(Debug, Clone, PartialEq, Eq, Copy)] @@ -27,4 +29,10 @@ impl Move { pub fn is_tactical(&self) -> bool { matches!(self.kind, MoveKind::Capture | MoveKind::EnPassant) } + + pub fn from_notation(mut notation: Chars) -> Self { + let source = Square::from_notation(&mut notation).unwrap(); + let target = Square::from_notation(&mut notation).unwrap(); + Move { source, target, kind: MoveKind::Quiet } + } } -- cgit v1.2.3