pub fn to_sfen(&self) -> String {
        if self.sfen_history.is_empty() {
            return self.generate_sfen();
        }

        if self.move_history.is_empty() {
            return format!("{} {}", self.sfen_history.first().unwrap().0, self.ply);
        }

        let mut sfen = format!(
            "{} {} moves",
            &self.sfen_history.first().unwrap().0,
            self.ply - self.move_history.len() as u16
        );

        for m in self.move_history.iter() {
            sfen.push_str(&format!(" {}", &m.to_sfen()));
        }

        sfen
    }
/// Converts the current state into SFEN formatted string.
Converts the current state into SFEN formatted string.
Converts the current state into SFEN formatted string .
pub fn to_sfen(&self) -> String {
        if self.sfen_history.is_empty() {
            return self.generate_sfen();
        }
        if self.move_history.is_empty() {
            return format!("{} {}", self.sfen_history.first().unwrap().0, self.ply);
        }
        let mut sfen = format!(
            "{} {} moves",
            &self.sfen_history.first().unwrap().0,
            self.ply - self.move_history.len() as u16
        );
        for m in self.move_history.iter() {
            sfen.push_str(&format!(" {}", &m.to_sfen()));
        }
        sfen
    }
pub fn to_sfen ( & self ) -> String { if self . sfen_history . is_empty ( ) { return self . generate_sfen ( ) ; } if self . move_history . is_empty ( ) { return format ! ( " " self sfen_history first ( ) unwrap ( ) 0 self ply ) ; } let mut sfen = format ! ( " " self sfen_history first ( ) unwrap ( ) 0 self ply self move_history len ( ) as u16 ) ; for m in self . move_history . iter ( ) { sfen . push_str ( & format ! ( " " m to_sfen ( ) ) ) ; } sfen }
Converts the current state into SFEN formatted string.
Converts the current state into SFEN formatted string .
&self