lib/chess/game.rb
# Prompts player to choose a chess piece to move and returns
# the location of the piece
Prompts player to choose a chess piece to move and returns
the location of the piece
Prompts player to choose a chess piece to move and returns the location of the piece
def player_choose_piece
      puts "What piece would you like to move?"
      print ">> "
      from_position = convert_location(gets.chomp)
      until @board.valid_player_piece?(@turn.color, from_position)
        puts "Not a valid piece! Try again."
        print ">> "
        from_position = convert_location(gets.chomp)
      end
      from_position
    end
def player_choose_piece puts "What piece would you like to move?" print ">> " from_position = convert_location ( gets . chomp ) until @board . valid_player_piece? ( @turn . color , from_position ) puts "Not a valid piece! Try again." print ">> " from_position = convert_location ( gets . chomp ) end from_position end
Prompts player to choose a chess piece to move and returns
the location of the piece
Prompts player to choose a chess piece to move and returns the location of the piece