README.md in chess_openings-1.0.1 vs README.md in chess_openings-1.0.2

- old
+ new

@@ -1,9 +1,10 @@ Chess Openings ========================== Ruby gem that where you can manipulate, search for and get information from chess openings. +Search, manipulate and get information on chess openings ## Features: - Get opening from PGN file - Get opening from PGN string - Get opening from array with moves - Get opening from FEN @@ -37,40 +38,40 @@ chess_openings = ChessOpenings.new ``` From here you can use several functions: -####.from_pgn +#### .from_pgn Get opening from PGN file ```ruby chess_openings = ChessOpenings.new opening = chess_openings.from_pgn('path_to/pgn_game.pgn') #=> #<Opening:0x007fda6237b510 @name="English, Sicilian reversed", @eco_code="A25", @moves=[:c4, :e5, :Nc3, :Nc6]> ``` -####.from_string +#### .from_string Get opening from a string, formated like a PGN file ```ruby chess_openings = ChessOpenings.new opening = chess_openings.from_string("1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Bxc6") #=> #<Opening:0x007f820961bf60 @name="Ruy Lopez, exchange variation", @eco_code="C68", @moves=[:e4, :e5, :Nf3, :Nc6, :Bb5, :a6, :Bxc6]> ``` -####.from_moves +#### .from_moves Get opening from an array with moves (as symbols or strings) ```ruby chess_openings = ChessOpenings.new opening = chess_openings.from_moves [:e4, :c6, :d4, :d5] #=> #<Opening:0x007f8209d9c910 @name="Caro-Kann defence", @eco_code="B12", @moves=[:e4, :c6, :d4, :d5]> ``` -####.with_name +#### .with_name Search openings by name ```ruby chess_openings = ChessOpenings.new openings = chess_openings.with_name "alekhine defence" @@ -82,11 +83,11 @@ ... ] =end ``` -####.all +#### .all Get all existing openings as an array ```ruby chess_openings = ChessOpenings.new all_openings = chess_openings.all @@ -98,11 +99,11 @@ ... ] =end ``` -####.that_start_with +#### .that_start_with Get all possible openings that start with determined moves ```ruby chess_openings = ChessOpenings.new e4_e5_openings = chess_openings.that_start_with [:e4, :e5] @@ -117,34 +118,30 @@ ... ] =end ``` -####.from_fen +#### .from_fen Get opening from FEN string ```ruby opening_from_fen = chess_openings.from_fen 'rnbqkbnr/pppp1ppp/8/4p3/4P3/8/PPPP1PPP/RNBQKBNR w KQkq e6 0 2' #=> #<Opening:0x007ff69c858258 @name="King's pawn game", @eco_code="C20", @moves=[:e4, :e5]> ``` - - - - When you have a opening you can invoke these methods on it: -####.to_pgn +#### .to_pgn Get PGN string from an opening ```ruby opening = chess_openings.from_moves [:e4, :e5, :Nf3, :Nc6, :Bb5, :a6, :Bxc6] #=> #<Opening:0x007f820961bf60 @name="Ruy Lopez, exchange variation", @eco_code="C68", @moves=[:e4, :e5, :Nf3, :Nc6, :Bb5, :a6, :Bxc6]> opening.to_pgn #=> "1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Bxc6" ``` -####.to_fen +#### .to_fen Get FEN string of the opening ```ruby opening = chess_openings.from_moves [:e4, :e5] #=> #<Opening:0x007ff69c858258 @name="King's pawn game", @eco_code="C20", @moves=[:e4, :e5]>