chess 0.2.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
 - data/.github/FUNDING.yml +12 -0
 - data/.github/workflows/ruby.yml +58 -0
 - data/.gitignore +2 -2
 - data/.rubocop.yml +51 -0
 - data/Gemfile +1 -1
 - data/Gemfile.lock +70 -0
 - data/README.md +26 -22
 - data/Rakefile +5 -4
 - data/chess.gemspec +15 -11
 - data/docs/Chess.html +157 -0
 - data/docs/Chess/BadNotationError.html +237 -0
 - data/docs/Chess/Board.html +1759 -0
 - data/docs/Chess/CGame.html +2296 -0
 - data/docs/Chess/Game.html +1277 -0
 - data/docs/Chess/Gnuchess.html +366 -0
 - data/docs/Chess/IllegalMoveError.html +137 -0
 - data/docs/Chess/InvalidFenFormatError.html +237 -0
 - data/docs/Chess/InvalidPgnFormatError.html +217 -0
 - data/docs/Chess/Pgn.html +1477 -0
 - data/docs/Chess/UTF8Notation.html +270 -0
 - data/docs/_index.html +217 -0
 - data/docs/class_list.html +51 -0
 - data/docs/css/common.css +1 -0
 - data/docs/css/full_list.css +58 -0
 - data/docs/css/style.css +497 -0
 - data/docs/file.README.html +116 -0
 - data/docs/file_list.html +56 -0
 - data/docs/frames.html +17 -0
 - data/docs/index.html +116 -0
 - data/docs/js/app.js +314 -0
 - data/docs/js/full_list.js +216 -0
 - data/docs/js/jquery.js +4 -0
 - data/docs/method_list.html +531 -0
 - data/docs/top-level-namespace.html +110 -0
 - data/ext/bitboard.c +1 -1
 - data/ext/bitboard.h +1 -1
 - data/ext/board.c +1 -1
 - data/ext/board.h +1 -1
 - data/ext/chess.c +2 -2
 - data/ext/chess.h +1 -1
 - data/ext/common.c +1 -1
 - data/ext/common.h +8 -4
 - data/ext/extconf.rb +7 -6
 - data/ext/game.c +2 -2
 - data/ext/game.h +1 -1
 - data/ext/special.c +10 -3
 - data/ext/special.h +3 -2
 - data/lib/chess/exceptions.rb +2 -5
 - data/lib/chess/game.rb +55 -77
 - data/lib/chess/gnuchess.rb +24 -27
 - data/lib/chess/pgn.rb +32 -26
 - data/lib/chess/utf8_notation.rb +3 -3
 - data/lib/chess/version.rb +1 -1
 - data/test/test_big_pgn_collection.rb +3 -4
 - data/test/test_checkmate.rb +4 -6
 - data/test/test_errors.rb +22 -0
 - data/test/test_fifty_rule_move.rb +2 -4
 - data/test/test_game.rb +82 -0
 - data/test/test_helper.rb +16 -3
 - data/test/test_illegal_moves.rb +1 -3
 - data/test/test_insufficient_material.rb +6 -7
 - data/test/test_load_fen.rb +11 -1
 - data/test/test_move_generator.rb +13 -14
 - data/test/test_particular_situations.rb +0 -2
 - data/test/test_pgn.rb +82 -1
 - data/test/test_pgn_collection.rb +2 -2
 - data/test/test_stalemate.rb +1 -3
 - data/test/test_threefold_repetition.rb +1 -3
 - metadata +145 -15
 
    
        data/test/test_illegal_moves.rb
    CHANGED
    
    | 
         @@ -1,14 +1,12 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require 'test_helper'
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            class ChessTest < Minitest::Test
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
4 
     | 
    
         
             
              def test_illegal_moves
         
     | 
| 
       6 
5 
     | 
    
         
             
                game = Chess::Game.new
         
     | 
| 
       7 
     | 
    
         
            -
                %w 
     | 
| 
      
 6 
     | 
    
         
            +
                %w[Qf6 Rd4 Nc3=Q].each do |move|
         
     | 
| 
       8 
7 
     | 
    
         
             
                  assert_raises(Chess::IllegalMoveError) do
         
     | 
| 
       9 
8 
     | 
    
         
             
                    game << move
         
     | 
| 
       10 
9 
     | 
    
         
             
                  end
         
     | 
| 
       11 
10 
     | 
    
         
             
                end
         
     | 
| 
       12 
11 
     | 
    
         
             
              end
         
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
12 
     | 
    
         
             
            end
         
     | 
| 
         @@ -7,25 +7,25 @@ class ChessTest < Minitest::Test 
     | 
|
| 
       7 
7 
     | 
    
         
             
                '8/2k5/8/3b4/B7/8/2K5/8 w - - 0 1',
         
     | 
| 
       8 
8 
     | 
    
         
             
                '8/2k5/8/8/4B3/8/2K5/8 w - - 0 1',
         
     | 
| 
       9 
9 
     | 
    
         
             
                '8/2k5/8/5b2/8/8/2K5/8 w - - 0 1'
         
     | 
| 
       10 
     | 
    
         
            -
              ]
         
     | 
| 
      
 10 
     | 
    
         
            +
              ].freeze
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
12 
     | 
    
         
             
              ONLY_KINGS_FENS = [
         
     | 
| 
       13 
13 
     | 
    
         
             
                '8/2k5/8/8/8/8/2K5/8 w - - 0 1',
         
     | 
| 
       14 
14 
     | 
    
         
             
                '8/4k3/8/8/1K6/8/8/8 w - - 0 1'
         
     | 
| 
       15 
     | 
    
         
            -
              ]
         
     | 
| 
      
 15 
     | 
    
         
            +
              ].freeze
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
              FENS.each_with_index do |fen, i|
         
     | 
| 
       18 
18 
     | 
    
         
             
                define_method("test_insufficient_material_by_fen_#{i}") do
         
     | 
| 
       19 
19 
     | 
    
         
             
                  game = Chess::Game.load_fen(fen)
         
     | 
| 
       20 
     | 
    
         
            -
                  assert 
     | 
| 
      
 20 
     | 
    
         
            +
                  assert game.board.insufficient_material?
         
     | 
| 
       21 
21 
     | 
    
         
             
                end
         
     | 
| 
       22 
22 
     | 
    
         
             
              end
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
24 
     | 
    
         
             
              ONLY_KINGS_FENS.each_with_index do |fen, i|
         
     | 
| 
       25 
25 
     | 
    
         
             
                define_method("test_only_kings_by_fen_#{i}") do
         
     | 
| 
       26 
26 
     | 
    
         
             
                  game = Chess::Game.load_fen(fen)
         
     | 
| 
       27 
     | 
    
         
            -
                  assert 
     | 
| 
       28 
     | 
    
         
            -
                  assert 
     | 
| 
      
 27 
     | 
    
         
            +
                  assert game.board.insufficient_material?
         
     | 
| 
      
 28 
     | 
    
         
            +
                  assert game.board.only_kings?
         
     | 
| 
       29 
29 
     | 
    
         
             
                end
         
     | 
| 
       30 
30 
     | 
    
         
             
              end
         
     | 
| 
       31 
31 
     | 
    
         | 
| 
         @@ -34,8 +34,7 @@ class ChessTest < Minitest::Test 
     | 
|
| 
       34 
34 
     | 
    
         
             
                define_method "test_insufficient_material_#{name}" do
         
     | 
| 
       35 
35 
     | 
    
         
             
                  pgn = Chess::Pgn.new(file)
         
     | 
| 
       36 
36 
     | 
    
         
             
                  game = Chess::Game.new(pgn.moves)
         
     | 
| 
       37 
     | 
    
         
            -
                  assert 
     | 
| 
      
 37 
     | 
    
         
            +
                  assert game.board.insufficient_material?
         
     | 
| 
       38 
38 
     | 
    
         
             
                end
         
     | 
| 
       39 
39 
     | 
    
         
             
              end
         
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
       41 
40 
     | 
    
         
             
            end
         
     | 
    
        data/test/test_load_fen.rb
    CHANGED
    
    | 
         @@ -1,7 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require 'test_helper'
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            class ChessTest < Minitest::Test
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
4 
     | 
    
         
             
              def test_fen_in_progress
         
     | 
| 
       6 
5 
     | 
    
         
             
                g = Chess::Game.load_fen('rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2')
         
     | 
| 
       7 
6 
     | 
    
         
             
                assert_equal 'P', g.board['e4']
         
     | 
| 
         @@ -38,4 +37,15 @@ class ChessTest < Minitest::Test 
     | 
|
| 
       38 
37 
     | 
    
         
             
                assert_equal :stalemate, g.status
         
     | 
| 
       39 
38 
     | 
    
         
             
              end
         
     | 
| 
       40 
39 
     | 
    
         | 
| 
      
 40 
     | 
    
         
            +
              def test_fen_castling_from
         
     | 
| 
      
 41 
     | 
    
         
            +
                g = Chess::Game.load_fen('2b1kbnr/rpq1pp1p/2n3p1/8/3Q4/2P5/PP3PPP/RN2KBNR w KQk - 0 9')
         
     | 
| 
      
 42 
     | 
    
         
            +
                g.move('Kd1')
         
     | 
| 
      
 43 
     | 
    
         
            +
                assert_equal '2b1kbnr/rpq1pp1p/2n3p1/8/3Q4/2P5/PP3PPP/RN1K1BNR b k - 1 9', g.board.to_fen
         
     | 
| 
      
 44 
     | 
    
         
            +
              end
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
              def test_fen_castling_to
         
     | 
| 
      
 47 
     | 
    
         
            +
                g = Chess::Game.load_fen('2b1kbnr/rpq1pp1p/2n3p1/8/3Q4/2P5/PP3PPP/RN2KBNR w KQk - 0 9')
         
     | 
| 
      
 48 
     | 
    
         
            +
                g.move('Qh8')
         
     | 
| 
      
 49 
     | 
    
         
            +
                assert_equal '2b1kbnQ/rpq1pp1p/2n3p1/8/8/2P5/PP3PPP/RN2KBNR b KQ - 0 9', g.board.to_fen
         
     | 
| 
      
 50 
     | 
    
         
            +
              end
         
     | 
| 
       41 
51 
     | 
    
         
             
            end
         
     | 
    
        data/test/test_move_generator.rb
    CHANGED
    
    | 
         @@ -1,20 +1,20 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require 'test_helper'
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            class ChessTest < Minitest::Test
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
4 
     | 
    
         
             
              GENS = {
         
     | 
| 
       6 
     | 
    
         
            -
                'r2qk3/8/2n5/8/8/8/p2B4/4K2R w K - 0 1' => {'e1' => [ 
     | 
| 
       7 
     | 
    
         
            -
                'r2qk3/8/2n5/8/8/8/p2B4/4K2R w - - 0 1' => {'e1' => [ 
     | 
| 
       8 
     | 
    
         
            -
                'r2qk3/8/2n5/2b5/8/8/p2B4/4K2R w K - 0 1' => {'e1' => [ 
     | 
| 
       9 
     | 
    
         
            -
                'r2qk3/8/2n5/2b5/8/8/p2B4/4K2R b K - 0 1' => {'a2' => ['a1=Q']},
         
     | 
| 
       10 
     | 
    
         
            -
                'r2qk3/8/2n1n3/2b5/8/8/p2B4/4K2R b K - 0 1' => {'e6' => [ 
     | 
| 
       11 
     | 
    
         
            -
                'r2qk3/8/2n5/2b2pP1/8/8/3B4/4K2R w K f6 0 1' => {'g5' => [ 
     | 
| 
       12 
     | 
    
         
            -
                '1B1k4/r3q3/2n1n3/2b2pP1/8/1n6/3B4/4K2R b K - 0 1' => {'c6' => [ 
     | 
| 
       13 
     | 
    
         
            -
                '1B1k4/r3q3/2n1n3/2b2pP1/8/8/2nB4/3K3R b - - 0 1' => {'c6' => [ 
     | 
| 
       14 
     | 
    
         
            -
                '1B1k4/r3q3/2n1n2P/2b5/5p2/3p1RP1/3B4/3K4 w - - 0 1' => {'f3' => [ 
     | 
| 
       15 
     | 
    
         
            -
                'k7/1Q6/2P5/8/8/8/8/3K4 b - - 0 1' => {'a8' => []},
         
     | 
| 
       16 
     | 
    
         
            -
                'k7/6P1/8/8/8/3r4/3Q4/3K4 w - - 0 1' => {'d2' => ['Qxd3']}
         
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
      
 5 
     | 
    
         
            +
                'r2qk3/8/2n5/8/8/8/p2B4/4K2R w K - 0 1' => { 'e1' => %w[Kd1 Ke2 Kf2 Kf1 O-O] },
         
     | 
| 
      
 6 
     | 
    
         
            +
                'r2qk3/8/2n5/8/8/8/p2B4/4K2R w - - 0 1' => { 'e1' => %w[Kd1 Ke2 Kf2 Kf1] },
         
     | 
| 
      
 7 
     | 
    
         
            +
                'r2qk3/8/2n5/2b5/8/8/p2B4/4K2R w K - 0 1' => { 'e1' => %w[Kd1 Ke2 Kf1] },
         
     | 
| 
      
 8 
     | 
    
         
            +
                'r2qk3/8/2n5/2b5/8/8/p2B4/4K2R b K - 0 1' => { 'a2' => ['a1=Q'] },
         
     | 
| 
      
 9 
     | 
    
         
            +
                'r2qk3/8/2n1n3/2b5/8/8/p2B4/4K2R b K - 0 1' => { 'e6' => %w[Nf8 Ng7 Ng5 Nf4 Ned4 Nc7] },
         
     | 
| 
      
 10 
     | 
    
         
            +
                'r2qk3/8/2n5/2b2pP1/8/8/3B4/4K2R w K f6 0 1' => { 'g5' => %w[gxf6ep g6] },
         
     | 
| 
      
 11 
     | 
    
         
            +
                '1B1k4/r3q3/2n1n3/2b2pP1/8/1n6/3B4/4K2R b K - 0 1' => { 'c6' => %w[Nxb8 Ne5 Ncd4 Nb4 Nca5] },
         
     | 
| 
      
 12 
     | 
    
         
            +
                '1B1k4/r3q3/2n1n3/2b2pP1/8/8/2nB4/3K3R b - - 0 1' => { 'c6' => %w[Nxb8 Ne5 Nc6d4 N6b4 Na5] },
         
     | 
| 
      
 13 
     | 
    
         
            +
                '1B1k4/r3q3/2n1n2P/2b5/5p2/3p1RP1/3B4/3K4 w - - 0 1' => { 'f3' => %w[Rxd3 Re3 Rxf4 Rf2 Rf1] },
         
     | 
| 
      
 14 
     | 
    
         
            +
                'k7/1Q6/2P5/8/8/8/8/3K4 b - - 0 1' => { 'a8' => [] },
         
     | 
| 
      
 15 
     | 
    
         
            +
                'k7/6P1/8/8/8/3r4/3Q4/3K4 w - - 0 1' => { 'd2' => ['Qxd3'] },
         
     | 
| 
      
 16 
     | 
    
         
            +
                'rnbqkbnr/1ppppppp/8/8/pP2P3/P7/2PP1PPP/RNBQKBNR w KQkq - 0 3' => { 'c2' => %w[c3 c4] }
         
     | 
| 
      
 17 
     | 
    
         
            +
              }.freeze
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
              GENS.each do |fen, generators|
         
     | 
| 
       20 
20 
     | 
    
         
             
                define_method("test_move_generator_#{fen}") do
         
     | 
| 
         @@ -25,5 +25,4 @@ class ChessTest < Minitest::Test 
     | 
|
| 
       25 
25 
     | 
    
         
             
                  end
         
     | 
| 
       26 
26 
     | 
    
         
             
                end
         
     | 
| 
       27 
27 
     | 
    
         
             
              end
         
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
28 
     | 
    
         
             
            end
         
     | 
| 
         @@ -1,7 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require 'test_helper'
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            class ChessTest < Minitest::Test
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
4 
     | 
    
         
             
              def test_cant_castling
         
     | 
| 
       6 
5 
     | 
    
         
             
                game = Chess::Game.load_fen('2r1k2r/pR2p2p/2pn2Nb/P2p1p2/8/1P2P3/2PP4/2BQK3 b k - 1 3')
         
     | 
| 
       7 
6 
     | 
    
         
             
                assert_raises(Chess::IllegalMoveError) do
         
     | 
| 
         @@ -10,5 +9,4 @@ class ChessTest < Minitest::Test 
     | 
|
| 
       10 
9 
     | 
    
         
             
                game = Chess::Game.load_fen('2r1k2r/pR2p2p/2pn3b/P2p1p2/8/1P2P3/2PP4/2BQK3 b k - 1 3')
         
     | 
| 
       11 
10 
     | 
    
         
             
                game << 'O-O'
         
     | 
| 
       12 
11 
     | 
    
         
             
              end
         
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
12 
     | 
    
         
             
            end
         
     | 
    
        data/test/test_pgn.rb
    CHANGED
    
    | 
         @@ -1,7 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require 'test_helper'
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            class ChessTest < Minitest::Test
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
4 
     | 
    
         
             
              TestHelper.pgns('invalid').each do |file|
         
     | 
| 
       6 
5 
     | 
    
         
             
                name = File.basename(file, '.pgn')
         
     | 
| 
       7 
6 
     | 
    
         
             
                define_method "test_invalid_pgn_#{name}" do
         
     | 
| 
         @@ -21,4 +20,86 @@ class ChessTest < Minitest::Test 
     | 
|
| 
       21 
20 
     | 
    
         
             
                end
         
     | 
| 
       22 
21 
     | 
    
         
             
              end
         
     | 
| 
       23 
22 
     | 
    
         | 
| 
      
 23 
     | 
    
         
            +
              def test_load_from_string
         
     | 
| 
      
 24 
     | 
    
         
            +
                pgn_string = <<~PGN
         
     | 
| 
      
 25 
     | 
    
         
            +
                  [Event "70th ch-ITA"]
         
     | 
| 
      
 26 
     | 
    
         
            +
                  [Site "Siena ITA"]
         
     | 
| 
      
 27 
     | 
    
         
            +
                  [Round "10"]
         
     | 
| 
      
 28 
     | 
    
         
            +
                  [Date "2010.12.3"]
         
     | 
| 
      
 29 
     | 
    
         
            +
                  [White "Caruana, Fabiano"]
         
     | 
| 
      
 30 
     | 
    
         
            +
                  [Black "Godena, Michele"]
         
     | 
| 
      
 31 
     | 
    
         
            +
                  [Result "1-0"]
         
     | 
| 
      
 32 
     | 
    
         
            +
                  1.d4 d5 2.c4 dxc4 3.e4 e5 4.Nf3 Bb4+ 5.Nc3 exd4 6.Nxd4 Ne7 7.Bf4 Bxc3+ 8.bxc3 Ng6 9.Bg3 Qe7 10.Bxc4 Qxe4+ 11.Qe2 Qxe2+ 12.Bxe2 Na6 13.Rb1 O-O 14.O-O Re8 15.Rfe1 Nc5 16.Bxc7 Bd7 17.Bf3 Rxe1+ 18.Rxe1 Rc8 19.Bg3 b6 20.h4 Ne6 21.h5 Ne7 22.Be5 Nc6 23.Nxc6 Bxc6 24.Bg4 Re8 25.Bg3 g6 26.h6 f5 27.Bd1 f4 28.Bh4 Kf8 29.Re5 g5 30.Bh5 Rc8 31.Bxg5 Nxg5 32.Rxg5 Bd7 33.Rg7 Rc5 34.Bf3 Bf5 35.Rxa7 Rxc3 36.Bd5 Bg6 37.Ra4 Rc1+ 38.Kh2 Rc5 39.Rxf4+ Ke7 40.Bf3 Ra5 41.Rb4 b5 42.Bd5 Kf6 43.f4 Bf5 44.Bc6 Bd3 45.Rd4 Ra3 46.Bd5 Bb1 47.Rd1 Bd3 48.Bb3 Bc4 49.Bc2 Ke7 50.Bf5 Rxa2 51.Rd7+ Kf8 52.Rxh7 Bd5 53.Rd7 1-0
         
     | 
| 
      
 33 
     | 
    
         
            +
                PGN
         
     | 
| 
      
 34 
     | 
    
         
            +
                pgn = Chess::Pgn.new
         
     | 
| 
      
 35 
     | 
    
         
            +
                pgn.load_from_string(pgn_string, check_moves: true)
         
     | 
| 
      
 36 
     | 
    
         
            +
                assert_equal '70th ch-ITA', pgn.event
         
     | 
| 
      
 37 
     | 
    
         
            +
                assert_equal 'Siena ITA', pgn.site
         
     | 
| 
      
 38 
     | 
    
         
            +
                assert_equal '10', pgn.round
         
     | 
| 
      
 39 
     | 
    
         
            +
                assert_equal '2010.12.3', pgn.date
         
     | 
| 
      
 40 
     | 
    
         
            +
                assert_equal 'Caruana, Fabiano', pgn.white
         
     | 
| 
      
 41 
     | 
    
         
            +
                assert_equal 'Godena, Michele', pgn.black
         
     | 
| 
      
 42 
     | 
    
         
            +
                assert_equal 'Godena, Michele', pgn.black
         
     | 
| 
      
 43 
     | 
    
         
            +
                assert_equal '1-0', pgn.result
         
     | 
| 
      
 44 
     | 
    
         
            +
                assert_equal 'Rd7', pgn.moves.last
         
     | 
| 
      
 45 
     | 
    
         
            +
              end
         
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
      
 47 
     | 
    
         
            +
              def test_load_from_string_without_tags
         
     | 
| 
      
 48 
     | 
    
         
            +
                pgn_string = <<~PGN
         
     | 
| 
      
 49 
     | 
    
         
            +
                  1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 {This opening is called the Ruy Lopez.}
         
     | 
| 
      
 50 
     | 
    
         
            +
                  4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nb8 10. d4 Nbd7
         
     | 
| 
      
 51 
     | 
    
         
            +
                  11. c4 c6 12. cxb5 axb5 13. Nc3 Bb7 14. Bg5 b4 15. Nb1 h6 16. Bh4 c5 17. dxe5
         
     | 
| 
      
 52 
     | 
    
         
            +
                  Nxe4 18. Bxe7 Qxe7 19. exd6 Qf6 20. Nbd2 Nxd6 21. Nc4 Nxc4 22. Bxc4 Nb6
         
     | 
| 
      
 53 
     | 
    
         
            +
                  23. Ne5 Rae8 24. Bxf7+ Rxf7 25. Nxf7 Rxe1+ 26. Qxe1 Kxf7 27. Qe3 Qg5 28. Qxg5
         
     | 
| 
      
 54 
     | 
    
         
            +
                  hxg5 29. b3 Ke6 30. a3 Kd6 31. axb4 cxb4 32. Ra5 Nd5 33. f3 Bc8 34. Kf2 Bf5
         
     | 
| 
      
 55 
     | 
    
         
            +
                  35. Ra7 g6 36. Ra6+ Kc5 37. Ke1 Nf4 38. g3 Nxh3 39. Kd2 Kb5 40. Rd6 Kc5 41. Ra6
         
     | 
| 
      
 56 
     | 
    
         
            +
                  Nf2 42. g4 Bd3 43. Re6 1/2-1/2
         
     | 
| 
      
 57 
     | 
    
         
            +
                PGN
         
     | 
| 
      
 58 
     | 
    
         
            +
                pgn = Chess::Pgn.new
         
     | 
| 
      
 59 
     | 
    
         
            +
                pgn.load_from_string(pgn_string, check_moves: true)
         
     | 
| 
      
 60 
     | 
    
         
            +
                assert_nil pgn.event
         
     | 
| 
      
 61 
     | 
    
         
            +
                assert_nil pgn.site
         
     | 
| 
      
 62 
     | 
    
         
            +
                assert_nil pgn.round
         
     | 
| 
      
 63 
     | 
    
         
            +
                assert_nil pgn.date
         
     | 
| 
      
 64 
     | 
    
         
            +
                assert_nil pgn.white
         
     | 
| 
      
 65 
     | 
    
         
            +
                assert_nil pgn.black
         
     | 
| 
      
 66 
     | 
    
         
            +
                assert_nil pgn.black
         
     | 
| 
      
 67 
     | 
    
         
            +
                assert_nil pgn.result
         
     | 
| 
      
 68 
     | 
    
         
            +
                assert_equal 'Re6', pgn.moves.last
         
     | 
| 
      
 69 
     | 
    
         
            +
              end
         
     | 
| 
      
 70 
     | 
    
         
            +
             
     | 
| 
      
 71 
     | 
    
         
            +
              def test_write_pgn
         
     | 
| 
      
 72 
     | 
    
         
            +
                tempfile = Tempfile.new('test_pgn')
         
     | 
| 
      
 73 
     | 
    
         
            +
                game = Chess::Game.new
         
     | 
| 
      
 74 
     | 
    
         
            +
                game.moves = %w[e4 e5 d3]
         
     | 
| 
      
 75 
     | 
    
         
            +
                pgn = game.pgn
         
     | 
| 
      
 76 
     | 
    
         
            +
                pgn.event = 'Ruby Chess Tournament'
         
     | 
| 
      
 77 
     | 
    
         
            +
                pgn.site = 'Ruby Chess test suite'
         
     | 
| 
      
 78 
     | 
    
         
            +
                pgn.date = '1984.10.21'
         
     | 
| 
      
 79 
     | 
    
         
            +
                pgn.round = '2'
         
     | 
| 
      
 80 
     | 
    
         
            +
                pgn.white = 'Pioz'
         
     | 
| 
      
 81 
     | 
    
         
            +
                pgn.black = 'Elizabeth Harmon'
         
     | 
| 
      
 82 
     | 
    
         
            +
                pgn.write(tempfile.path)
         
     | 
| 
      
 83 
     | 
    
         
            +
             
     | 
| 
      
 84 
     | 
    
         
            +
                loaded_pgn = Chess::Pgn.new
         
     | 
| 
      
 85 
     | 
    
         
            +
                loaded_pgn.load(tempfile.path)
         
     | 
| 
      
 86 
     | 
    
         
            +
                tempfile.delete
         
     | 
| 
      
 87 
     | 
    
         
            +
                assert_equal 'Ruby Chess Tournament', loaded_pgn.event
         
     | 
| 
      
 88 
     | 
    
         
            +
                assert_equal 'Ruby Chess test suite', loaded_pgn.site
         
     | 
| 
      
 89 
     | 
    
         
            +
                assert_equal '1984.10.21', loaded_pgn.date
         
     | 
| 
      
 90 
     | 
    
         
            +
                assert_equal '2', loaded_pgn.round
         
     | 
| 
      
 91 
     | 
    
         
            +
                assert_equal 'Pioz', loaded_pgn.white
         
     | 
| 
      
 92 
     | 
    
         
            +
                assert_equal 'Elizabeth Harmon', loaded_pgn.black
         
     | 
| 
      
 93 
     | 
    
         
            +
                assert_equal '*', loaded_pgn.result
         
     | 
| 
      
 94 
     | 
    
         
            +
                assert_equal %w[e4 e5 d3], loaded_pgn.moves
         
     | 
| 
      
 95 
     | 
    
         
            +
              end
         
     | 
| 
      
 96 
     | 
    
         
            +
             
     | 
| 
      
 97 
     | 
    
         
            +
              def test_set_date
         
     | 
| 
      
 98 
     | 
    
         
            +
                pgn = Chess::Pgn.new
         
     | 
| 
      
 99 
     | 
    
         
            +
                pgn.date = Time.parse('21-10-1984')
         
     | 
| 
      
 100 
     | 
    
         
            +
                assert_equal '1984.10.21', pgn.date
         
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
| 
      
 102 
     | 
    
         
            +
                pgn.date = '1984.10.21'
         
     | 
| 
      
 103 
     | 
    
         
            +
                assert_equal '1984.10.21', pgn.date
         
     | 
| 
      
 104 
     | 
    
         
            +
              end
         
     | 
| 
       24 
105 
     | 
    
         
             
            end
         
     | 
    
        data/test/test_pgn_collection.rb
    CHANGED
    
    | 
         @@ -8,8 +8,8 @@ class ChessTest < Minitest::Test 
     | 
|
| 
       8 
8 
     | 
    
         
             
                  game = Chess::Game.new
         
     | 
| 
       9 
9 
     | 
    
         
             
                  pgn.moves.each do |m|
         
     | 
| 
       10 
10 
     | 
    
         
             
                    game.move(m)
         
     | 
| 
       11 
     | 
    
         
            -
                    assert(game.board.check?) if m 
     | 
| 
       12 
     | 
    
         
            -
                    assert(game.board.checkmate?) if m 
     | 
| 
      
 11 
     | 
    
         
            +
                    assert(game.board.check?) if m.match?(/\+$/)
         
     | 
| 
      
 12 
     | 
    
         
            +
                    assert(game.board.checkmate?) if m.match?(/\#$/)
         
     | 
| 
       13 
13 
     | 
    
         
             
                  end
         
     | 
| 
       14 
14 
     | 
    
         
             
                end
         
     | 
| 
       15 
15 
     | 
    
         
             
                define_method "test_pgn_result_#{name}" do
         
     | 
    
        data/test/test_stalemate.rb
    CHANGED
    
    | 
         @@ -1,15 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require 'test_helper'
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            class ChessTest < Minitest::Test
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
4 
     | 
    
         
             
              TestHelper.pgns('stalemate').each do |file|
         
     | 
| 
       6 
5 
     | 
    
         
             
                name = File.basename(file, '.pgn')
         
     | 
| 
       7 
6 
     | 
    
         
             
                define_method "test_stalemate_#{name}" do
         
     | 
| 
       8 
7 
     | 
    
         
             
                  pgn = Chess::Pgn.new(file)
         
     | 
| 
       9 
8 
     | 
    
         
             
                  game = Chess::Game.new(pgn.moves)
         
     | 
| 
       10 
9 
     | 
    
         
             
                  assert(game.board.stalemate?)
         
     | 
| 
       11 
     | 
    
         
            -
                  assert_equal( 
     | 
| 
      
 10 
     | 
    
         
            +
                  assert_equal('1/2-1/2', game.result)
         
     | 
| 
       12 
11 
     | 
    
         
             
                end
         
     | 
| 
       13 
12 
     | 
    
         
             
              end
         
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
13 
     | 
    
         
             
            end
         
     | 
| 
         @@ -1,14 +1,12 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require 'test_helper'
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            class ChessTest < Minitest::Test
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
4 
     | 
    
         
             
              TestHelper.pgns('threefold_repetition').each do |file|
         
     | 
| 
       6 
5 
     | 
    
         
             
                name = File.basename(file, '.pgn')
         
     | 
| 
       7 
6 
     | 
    
         
             
                define_method "test_threefold_repetition_#{name}" do
         
     | 
| 
       8 
7 
     | 
    
         
             
                  pgn = Chess::Pgn.new(file)
         
     | 
| 
       9 
8 
     | 
    
         
             
                  game = Chess::Game.new(pgn.moves)
         
     | 
| 
       10 
     | 
    
         
            -
                  assert 
     | 
| 
      
 9 
     | 
    
         
            +
                  assert game.threefold_repetition?
         
     | 
| 
       11 
10 
     | 
    
         
             
                end
         
     | 
| 
       12 
11 
     | 
    
         
             
              end
         
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
12 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: chess
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.2 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.3.2
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Enrico Pilotto
         
     | 
| 
       8 
     | 
    
         
            -
            autorequire: 
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-01-28 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     | 
| 
         @@ -16,42 +16,140 @@ dependencies: 
     | 
|
| 
       16 
16 
     | 
    
         
             
                requirements:
         
     | 
| 
       17 
17 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       18 
18 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       19 
     | 
    
         
            -
                    version: ' 
     | 
| 
      
 19 
     | 
    
         
            +
                    version: '2'
         
     | 
| 
       20 
20 
     | 
    
         
             
              type: :development
         
     | 
| 
       21 
21 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       22 
22 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       23 
23 
     | 
    
         
             
                requirements:
         
     | 
| 
       24 
24 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       25 
25 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       26 
     | 
    
         
            -
                    version: ' 
     | 
| 
      
 26 
     | 
    
         
            +
                    version: '2'
         
     | 
| 
       27 
27 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       28 
     | 
    
         
            -
              name:  
     | 
| 
      
 28 
     | 
    
         
            +
              name: byebug
         
     | 
| 
      
 29 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 30 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 31 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 32 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 33 
     | 
    
         
            +
                    version: '11'
         
     | 
| 
      
 34 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 35 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 36 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 37 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 38 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 39 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 40 
     | 
    
         
            +
                    version: '11'
         
     | 
| 
      
 41 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 42 
     | 
    
         
            +
              name: codecov
         
     | 
| 
       29 
43 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       30 
44 
     | 
    
         
             
                requirements:
         
     | 
| 
       31 
45 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       32 
46 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       33 
     | 
    
         
            -
                    version: ' 
     | 
| 
      
 47 
     | 
    
         
            +
                    version: '0.4'
         
     | 
| 
       34 
48 
     | 
    
         
             
              type: :development
         
     | 
| 
       35 
49 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       36 
50 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       37 
51 
     | 
    
         
             
                requirements:
         
     | 
| 
       38 
52 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       39 
53 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       40 
     | 
    
         
            -
                    version: ' 
     | 
| 
      
 54 
     | 
    
         
            +
                    version: '0.4'
         
     | 
| 
       41 
55 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       42 
56 
     | 
    
         
             
              name: minitest
         
     | 
| 
       43 
57 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       44 
58 
     | 
    
         
             
                requirements:
         
     | 
| 
       45 
59 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       46 
60 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       47 
     | 
    
         
            -
                    version: '5 
     | 
| 
      
 61 
     | 
    
         
            +
                    version: '5'
         
     | 
| 
      
 62 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 63 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 64 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 65 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 66 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 67 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 68 
     | 
    
         
            +
                    version: '5'
         
     | 
| 
      
 69 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 70 
     | 
    
         
            +
              name: rake
         
     | 
| 
      
 71 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 72 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 73 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 74 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 75 
     | 
    
         
            +
                    version: '13'
         
     | 
| 
      
 76 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 77 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 78 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 79 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 80 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 81 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 82 
     | 
    
         
            +
                    version: '13'
         
     | 
| 
      
 83 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 84 
     | 
    
         
            +
              name: rubocop
         
     | 
| 
      
 85 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 86 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 87 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 88 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 89 
     | 
    
         
            +
                    version: '1'
         
     | 
| 
      
 90 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 91 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 92 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 93 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 94 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 95 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 96 
     | 
    
         
            +
                    version: '1'
         
     | 
| 
      
 97 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 98 
     | 
    
         
            +
              name: rubocop-minitest
         
     | 
| 
      
 99 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 100 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 101 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 102 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 103 
     | 
    
         
            +
                    version: '0.10'
         
     | 
| 
      
 104 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 105 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 106 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 107 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 108 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 109 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 110 
     | 
    
         
            +
                    version: '0.10'
         
     | 
| 
      
 111 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 112 
     | 
    
         
            +
              name: rubocop-performance
         
     | 
| 
      
 113 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 114 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 115 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 116 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 117 
     | 
    
         
            +
                    version: '1'
         
     | 
| 
      
 118 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 119 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 120 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 121 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 122 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 123 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 124 
     | 
    
         
            +
                    version: '1'
         
     | 
| 
      
 125 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 126 
     | 
    
         
            +
              name: rubocop-rake
         
     | 
| 
      
 127 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 128 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 129 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 130 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 131 
     | 
    
         
            +
                    version: '0.5'
         
     | 
| 
      
 132 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 133 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 134 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 135 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 136 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 137 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 138 
     | 
    
         
            +
                    version: '0.5'
         
     | 
| 
      
 139 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 140 
     | 
    
         
            +
              name: simplecov
         
     | 
| 
      
 141 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 142 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 143 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 144 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 145 
     | 
    
         
            +
                    version: '0.21'
         
     | 
| 
       48 
146 
     | 
    
         
             
              type: :development
         
     | 
| 
       49 
147 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       50 
148 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       51 
149 
     | 
    
         
             
                requirements:
         
     | 
| 
       52 
150 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       53 
151 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       54 
     | 
    
         
            -
                    version: ' 
     | 
| 
      
 152 
     | 
    
         
            +
                    version: '0.21'
         
     | 
| 
       55 
153 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       56 
154 
     | 
    
         
             
              name: yard
         
     | 
| 
       57 
155 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -74,12 +172,41 @@ extensions: 
     | 
|
| 
       74 
172 
     | 
    
         
             
            - ext/extconf.rb
         
     | 
| 
       75 
173 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       76 
174 
     | 
    
         
             
            files:
         
     | 
| 
      
 175 
     | 
    
         
            +
            - ".github/FUNDING.yml"
         
     | 
| 
      
 176 
     | 
    
         
            +
            - ".github/workflows/ruby.yml"
         
     | 
| 
       77 
177 
     | 
    
         
             
            - ".gitignore"
         
     | 
| 
      
 178 
     | 
    
         
            +
            - ".rubocop.yml"
         
     | 
| 
       78 
179 
     | 
    
         
             
            - Gemfile
         
     | 
| 
      
 180 
     | 
    
         
            +
            - Gemfile.lock
         
     | 
| 
       79 
181 
     | 
    
         
             
            - LICENSE
         
     | 
| 
       80 
182 
     | 
    
         
             
            - README.md
         
     | 
| 
       81 
183 
     | 
    
         
             
            - Rakefile
         
     | 
| 
       82 
184 
     | 
    
         
             
            - chess.gemspec
         
     | 
| 
      
 185 
     | 
    
         
            +
            - docs/Chess.html
         
     | 
| 
      
 186 
     | 
    
         
            +
            - docs/Chess/BadNotationError.html
         
     | 
| 
      
 187 
     | 
    
         
            +
            - docs/Chess/Board.html
         
     | 
| 
      
 188 
     | 
    
         
            +
            - docs/Chess/CGame.html
         
     | 
| 
      
 189 
     | 
    
         
            +
            - docs/Chess/Game.html
         
     | 
| 
      
 190 
     | 
    
         
            +
            - docs/Chess/Gnuchess.html
         
     | 
| 
      
 191 
     | 
    
         
            +
            - docs/Chess/IllegalMoveError.html
         
     | 
| 
      
 192 
     | 
    
         
            +
            - docs/Chess/InvalidFenFormatError.html
         
     | 
| 
      
 193 
     | 
    
         
            +
            - docs/Chess/InvalidPgnFormatError.html
         
     | 
| 
      
 194 
     | 
    
         
            +
            - docs/Chess/Pgn.html
         
     | 
| 
      
 195 
     | 
    
         
            +
            - docs/Chess/UTF8Notation.html
         
     | 
| 
      
 196 
     | 
    
         
            +
            - docs/_index.html
         
     | 
| 
      
 197 
     | 
    
         
            +
            - docs/class_list.html
         
     | 
| 
      
 198 
     | 
    
         
            +
            - docs/css/common.css
         
     | 
| 
      
 199 
     | 
    
         
            +
            - docs/css/full_list.css
         
     | 
| 
      
 200 
     | 
    
         
            +
            - docs/css/style.css
         
     | 
| 
      
 201 
     | 
    
         
            +
            - docs/file.README.html
         
     | 
| 
      
 202 
     | 
    
         
            +
            - docs/file_list.html
         
     | 
| 
      
 203 
     | 
    
         
            +
            - docs/frames.html
         
     | 
| 
      
 204 
     | 
    
         
            +
            - docs/index.html
         
     | 
| 
      
 205 
     | 
    
         
            +
            - docs/js/app.js
         
     | 
| 
      
 206 
     | 
    
         
            +
            - docs/js/full_list.js
         
     | 
| 
      
 207 
     | 
    
         
            +
            - docs/js/jquery.js
         
     | 
| 
      
 208 
     | 
    
         
            +
            - docs/method_list.html
         
     | 
| 
      
 209 
     | 
    
         
            +
            - docs/top-level-namespace.html
         
     | 
| 
       83 
210 
     | 
    
         
             
            - ext/MakefileC
         
     | 
| 
       84 
211 
     | 
    
         
             
            - ext/bitboard.c
         
     | 
| 
       85 
212 
     | 
    
         
             
            - ext/bitboard.h
         
     | 
| 
         @@ -1310,7 +1437,9 @@ files: 
     | 
|
| 
       1310 
1437 
     | 
    
         
             
            - test/pgn_collection/valid/1000.pgn
         
     | 
| 
       1311 
1438 
     | 
    
         
             
            - test/test_big_pgn_collection.rb
         
     | 
| 
       1312 
1439 
     | 
    
         
             
            - test/test_checkmate.rb
         
     | 
| 
      
 1440 
     | 
    
         
            +
            - test/test_errors.rb
         
     | 
| 
       1313 
1441 
     | 
    
         
             
            - test/test_fifty_rule_move.rb
         
     | 
| 
      
 1442 
     | 
    
         
            +
            - test/test_game.rb
         
     | 
| 
       1314 
1443 
     | 
    
         
             
            - test/test_helper.rb
         
     | 
| 
       1315 
1444 
     | 
    
         
             
            - test/test_illegal_moves.rb
         
     | 
| 
       1316 
1445 
     | 
    
         
             
            - test/test_insufficient_material.rb
         
     | 
| 
         @@ -1325,7 +1454,7 @@ homepage: https://github.com/pioz/chess 
     | 
|
| 
       1325 
1454 
     | 
    
         
             
            licenses:
         
     | 
| 
       1326 
1455 
     | 
    
         
             
            - LGPLv3
         
     | 
| 
       1327 
1456 
     | 
    
         
             
            metadata: {}
         
     | 
| 
       1328 
     | 
    
         
            -
            post_install_message: 
     | 
| 
      
 1457 
     | 
    
         
            +
            post_install_message:
         
     | 
| 
       1329 
1458 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       1330 
1459 
     | 
    
         
             
            require_paths:
         
     | 
| 
       1331 
1460 
     | 
    
         
             
            - lib
         
     | 
| 
         @@ -1333,16 +1462,15 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       1333 
1462 
     | 
    
         
             
              requirements:
         
     | 
| 
       1334 
1463 
     | 
    
         
             
              - - ">="
         
     | 
| 
       1335 
1464 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       1336 
     | 
    
         
            -
                  version: ' 
     | 
| 
      
 1465 
     | 
    
         
            +
                  version: '2.5'
         
     | 
| 
       1337 
1466 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       1338 
1467 
     | 
    
         
             
              requirements:
         
     | 
| 
       1339 
1468 
     | 
    
         
             
              - - ">="
         
     | 
| 
       1340 
1469 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       1341 
1470 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       1342 
1471 
     | 
    
         
             
            requirements: []
         
     | 
| 
       1343 
     | 
    
         
            -
             
     | 
| 
       1344 
     | 
    
         
            -
             
     | 
| 
       1345 
     | 
    
         
            -
            signing_key: 
         
     | 
| 
      
 1472 
     | 
    
         
            +
            rubygems_version: 3.0.2
         
     | 
| 
      
 1473 
     | 
    
         
            +
            signing_key:
         
     | 
| 
       1346 
1474 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       1347 
1475 
     | 
    
         
             
            summary: A fast chess library to play chess with Ruby.
         
     | 
| 
       1348 
1476 
     | 
    
         
             
            test_files:
         
     | 
| 
         @@ -2555,7 +2683,9 @@ test_files: 
     | 
|
| 
       2555 
2683 
     | 
    
         
             
            - test/pgn_collection/valid/1000.pgn
         
     | 
| 
       2556 
2684 
     | 
    
         
             
            - test/test_big_pgn_collection.rb
         
     | 
| 
       2557 
2685 
     | 
    
         
             
            - test/test_checkmate.rb
         
     | 
| 
      
 2686 
     | 
    
         
            +
            - test/test_errors.rb
         
     | 
| 
       2558 
2687 
     | 
    
         
             
            - test/test_fifty_rule_move.rb
         
     | 
| 
      
 2688 
     | 
    
         
            +
            - test/test_game.rb
         
     | 
| 
       2559 
2689 
     | 
    
         
             
            - test/test_helper.rb
         
     | 
| 
       2560 
2690 
     | 
    
         
             
            - test/test_illegal_moves.rb
         
     | 
| 
       2561 
2691 
     | 
    
         
             
            - test/test_insufficient_material.rb
         
     |