pgn 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67674551215924868ef976e50328c035e718d064
4
- data.tar.gz: 83baeece613b7cee8ccbdbdf648383bd03c94f55
3
+ metadata.gz: b261ae59ff2c1ee5680c4696e6012c4811639aa8
4
+ data.tar.gz: 8b59c74fbd3caad1a099b46962ae176ca8fde206
5
5
  SHA512:
6
- metadata.gz: 2dc3ad633890315dd863a7bf0892232761ebfb267f9769c4bec561bfe80d5125e0edabc631fd912e926d7039395c7920cbb9a2bf7c966adb24201fec6c7ab467
7
- data.tar.gz: a85bad51cefc2a9d90cd19ac78db6e96ab97c7646c14c74c3daef10dc55c871c17ab516bea12b6a7e77b41d2a9d9879cf3ab852763e2df374292577bdc0b3f53
6
+ metadata.gz: 89f69e5d76a923a8a335a9421ded37c0e4c9279849ffc30d2d70fb105f695ab8351b7e42c70c3e9f82cc2921d37403f0ec8ba57dee83c79087719badbd3c1f9c
7
+ data.tar.gz: f4a3055bff38e22b708c88259e37f297a4900091f3f48fddb7a83cdb070ac68f614af751ff58b2bece4e3475db8dca406c4e80a1c1498837de12e3c7903f1b5f
@@ -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]
@@ -119,10 +119,10 @@ module PGN
119
119
  PGN::Position.new(
120
120
  self.board,
121
121
  player,
122
- castling: castling,
123
- en_passant: en_passant,
124
- halfmove: self.halfmove.to_i,
125
- fullmove: self.fullmove.to_i,
122
+ castling,
123
+ en_passant,
124
+ self.halfmove.to_i,
125
+ self.fullmove.to_i,
126
126
  )
127
127
  end
128
128
 
@@ -1,3 +1,5 @@
1
+ require 'io/console'
2
+
1
3
  module PGN
2
4
  # {PGN::Game} holds all of the information about a game. It is either
3
5
  # the result of parsing a PGN file, or created by hand.
@@ -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: CASTLING, en_passant: nil, halfmove: 0, fullmove: 0)
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
- castling: new_castling,
99
- en_passant: calculator.en_passant_square,
100
- halfmove: new_halfmove,
101
- fullmove: new_fullmove,
94
+ new_castling,
95
+ calculator.en_passant_square,
96
+ new_halfmove,
97
+ new_fullmove,
102
98
  )
103
99
  end
104
100
 
@@ -1,3 +1,3 @@
1
1
  module PGN
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stacey Touset