class HumanPlayer

Attributes

mark[R]

Public Class Methods

new(mark, board, display) click to toggle source
# File lib/ttt_malisa/human_player.rb, line 4
def initialize(mark, board, display)
  @board = board
  @display = display
  @mark = mark
end

Public Instance Methods

move() click to toggle source
# File lib/ttt_malisa/human_player.rb, line 10
def move
  @display.make_move_message(@mark)
  index = @display.retrieve_user_input.to_i - 1
  @board.valid_move?(index) ? @board.mark(index, @mark) : move
end