Module: Tictactoe::SquaresContainer

Included in:
Board, Board::Row
Defined in:
lib/tictactoe/tictactoe.rb

Instance Method Summary collapse

Instance Method Details

#[](index) ⇒ Object



10
# File 'lib/tictactoe/tictactoe.rb', line 10

def []( index ) @squares[index] end

#blanksObject



12
# File 'lib/tictactoe/tictactoe.rb', line 12

def blanks()  @squares.find_all { |s| s == " " }.size end

#osObject



13
# File 'lib/tictactoe/tictactoe.rb', line 13

def os()      @squares.find_all { |s| s == "O" }.size end

#xsObject



14
# File 'lib/tictactoe/tictactoe.rb', line 14

def xs()      @squares.find_all { |s| s == "X" }.size end