12345678910111213141516171819202122 |
- // Load a PGN file containing a single game, and display that game, move by move
- pub fn main() {
- let fischer = pgn_filter::Games::from_file("examples/fischer.pgn").unwrap();
- println!("File has {} game(s)", fischer.iter().count());
- if fischer.iter().count() > 0 {
- let game = &fischer.iter().next().unwrap();
- for (board, mv) in game.iter() {
- println!("{}", board);
- println!("Move {}: {}{}",
- board.fullmove_number(),
- if board.player_to_move() == "White" { "" } else { "..." },
- mv
- );
- println!("");
- }
- }
- }
|