Sha256: d73a68d3dbe2279952308f0910057c303b25255f4e3a6b1fe1d4093e9299e9be

Contents?: true

Size: 354 Bytes

Versions: 1

Compression:

Stored size: 354 Bytes

Contents

#Assuming you have the gem installed, of course
require 'sgf'
parser = SGF::Parser.new

Dir['*.sgf'].each do |file|
  tree = parser.parse File.read(file)
  tree.games.each do |game|
    puts "White player: #{game.white_player} and Black player: #{game.black_player}"
  end
  tree.save file #Because may as well indent the files while I'm here, right?
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
SgfParser-2.0.0 examples/simple_iteration_of_games_in_a_directory.rb