pgn 0.0.2 → 0.0.3
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 +4 -4
- data/lib/pgn/board.rb +1 -1
- data/lib/pgn/fen.rb +4 -4
- data/lib/pgn/game.rb +2 -0
- data/lib/pgn/position.rb +5 -9
- data/lib/pgn/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b261ae59ff2c1ee5680c4696e6012c4811639aa8
|
4
|
+
data.tar.gz: 8b59c74fbd3caad1a099b46962ae176ca8fde206
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89f69e5d76a923a8a335a9421ded37c0e4c9279849ffc30d2d70fb105f695ab8351b7e42c70c3e9f82cc2921d37403f0ec8ba57dee83c79087719badbd3c1f9c
|
7
|
+
data.tar.gz: f4a3055bff38e22b708c88259e37f297a4900091f3f48fddb7a83cdb070ac68f614af751ff58b2bece4e3475db8dca406c4e80a1c1498837de12e3c7903f1b5f
|
data/lib/pgn/board.rb
CHANGED
@@ -144,7 +144,7 @@ module PGN
|
|
144
144
|
# board.coordinates_for("e4") #=> [4, 3]
|
145
145
|
#
|
146
146
|
def coordinates_for(position)
|
147
|
-
file_chr, rank_chr = position.chars
|
147
|
+
file_chr, rank_chr = position.chars.to_a
|
148
148
|
file = FILE_TO_INDEX[file_chr]
|
149
149
|
rank = RANK_TO_INDEX[rank_chr]
|
150
150
|
[file, rank]
|
data/lib/pgn/fen.rb
CHANGED
@@ -119,10 +119,10 @@ module PGN
|
|
119
119
|
PGN::Position.new(
|
120
120
|
self.board,
|
121
121
|
player,
|
122
|
-
castling
|
123
|
-
en_passant
|
124
|
-
|
125
|
-
|
122
|
+
castling,
|
123
|
+
en_passant,
|
124
|
+
self.halfmove.to_i,
|
125
|
+
self.fullmove.to_i,
|
126
126
|
)
|
127
127
|
end
|
128
128
|
|
data/lib/pgn/game.rb
CHANGED
data/lib/pgn/position.rb
CHANGED
@@ -43,10 +43,6 @@ module PGN
|
|
43
43
|
PGN::Position.new(
|
44
44
|
PGN::Board.start,
|
45
45
|
PLAYERS.first,
|
46
|
-
castling: CASTLING,
|
47
|
-
en_passant: nil,
|
48
|
-
halfmove: 0,
|
49
|
-
fullmove: 0,
|
50
46
|
)
|
51
47
|
end
|
52
48
|
|
@@ -65,7 +61,7 @@ module PGN
|
|
65
61
|
# :white,
|
66
62
|
# )
|
67
63
|
#
|
68
|
-
def initialize(board, player, castling
|
64
|
+
def initialize(board, player, castling = CASTLING, en_passant = nil, halfmove = 0, fullmove = 0)
|
69
65
|
self.board = board
|
70
66
|
self.player = player
|
71
67
|
self.castling = castling
|
@@ -95,10 +91,10 @@ module PGN
|
|
95
91
|
PGN::Position.new(
|
96
92
|
calculator.result_board,
|
97
93
|
self.next_player,
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
94
|
+
new_castling,
|
95
|
+
calculator.en_passant_square,
|
96
|
+
new_halfmove,
|
97
|
+
new_fullmove,
|
102
98
|
)
|
103
99
|
end
|
104
100
|
|
data/lib/pgn/version.rb
CHANGED