pgn2fen
Converts a single game chess PGN to an array of FEN strings. The FEN follows the specification as listed on Forsyth–Edwards Notation.
Usage
require 'pgn2fen'
fen_array = Pgn2Fen::Game.new(pgn_string).parse_pgn().fen_array
PGN header information is available in the Game object.
require 'pgn2fen'
game = Pgn2Fen::Game.new(pgn_string)
game.parse_pgn()
#FEN Array
puts game.fen_array
#PGN Header
puts game.event
puts game.site
puts game.date
puts game.eventdate
puts game.round
puts game.white
puts game.black
puts game.whiteelo
puts game.blackelo
puts game.result
puts game.eco
puts game.plycount
puts game.fen
Notes
All side lines are ignored - only main game is converted. Only a single game PGN is supported right now.