HELP on BATTLESHIP **Failure/Error: game.play_turn NoMethodError: undefined method `get_play' for #<Array:0x007fdefa9bca90>

I have been over my code a hundred times. I have checked the solutions and still cannot debug the code above. I would love some help please.
From my battleship.rb

def play
play_turn until game_over?
declare_win
end

def play_turn
pos = nil

until valid_play?(pos)
  display_current
  pos = player.get_play
end

attack(pos)

end

From my player.rb

class HumanPlayer

def initialize(name)
@name = name
end

def get_play
puts “Please enter a target square (i.e., ‘3,4’)”
gets.chomp.split(",").map(&:to_i)
end

end

Hi J0nrad,

Can I see where you are defining player in your battleship class? It looks like your get_play method is being called on an array, but player should be a player class object.

Michael

@mi-ruan

require_relative “board”
require_relative “player”

class BattleshipGame
attr_reader :board, :player

def initialize(player= HumanPlayer.new(“jonny”), board = Board.random)
@player = player,
@board = board,
@hit = false
end

Hi mi_ruan,

require_relative “board”
require_relative “player”

class BattleshipGame
attr_reader :board, :player

def initialize(player= HumanPlayer.new(“jonny”), board = Board.random)
@player = player,
@board = board,
@hit = false
end

Thank you for any help!

OH MY GOD

it was the commas

require_relative “board”
require_relative “player”

class BattleshipGame
attr_reader :board, :player

def initialize(player = HumanPlayer.new(“Jeff”), board = Board.random)
@player = player, <<<<
@board = board
@hit = false
end

Oh, yes. Good catch!