use owlchess::{
chain::{GameStatusPolicy, NumberPolicy},
movegen::legal,
moves::Style,
types::OutcomeFilter,
MoveChain,
};
use rand::{self, seq::SliceRandom};
fn main() {
let mut chain = MoveChain::new_initial();
let mut rng = rand::thread_rng();
while !chain.is_finished() {
let moves = legal::gen_all(chain.last());
let mv = moves
.choose(&mut rng)
.expect("no legal moves in this position");
chain
.push(*mv)
.expect("cannot make move generated by legal::gen_all()");
chain.set_auto_outcome(OutcomeFilter::Strict);
}
println!(
"{} {{{}}}",
chain.styled(NumberPolicy::FromBoard, Style::San, GameStatusPolicy::Show),
chain.outcome().unwrap(),
);
}