Class: Tictactoe::DumbPlayer

Inherits:
Player
  • Object
show all
Defined in:
lib/tictactoe/dumbplayer.rb

Instance Attribute Summary

Attributes inherited from Player

#mark

Instance Method Summary collapse

Methods inherited from Player

#initialize

Constructor Details

This class inherits a constructor from Tictactoe::Player

Instance Method Details

#move(board) ⇒ Object



5
6
7
8
# File 'lib/tictactoe/dumbplayer.rb', line 5

def move( board )
  moves = board.moves
  moves[rand(moves.size)]
end