lib/tak/board.rb
# Checks if a road win for `color` is present
#
# @param color [Symbol] Color to check for a win
#
# @return [Boolean]
Checks if a road win for `color` is present
Checks if a road win for ` color ` is present
def road_win?(color)
      current_bit_board = bit_board(color)
      path_search(0, 0, nil, current_bit_board) || !!@size.times.find { |n|
        path_search(1, n, :horizontal, current_bit_board) ||
        path_search(n, 1, :vertical, current_bit_board)
      }
    end
def road_win? ( color ) current_bit_board = bit_board ( color ) path_search ( 0 , 0 , nil , current_bit_board ) || ! ! @size . times . find { | n | path_search ( 1 , n , :horizontal , current_bit_board ) || path_search ( n , 1 , :vertical , current_bit_board ) } end
Checks if a road win for `color` is present
Checks if a road win for ` color ` is present
# Begin traversing through the board for potential roads.
None
Boolean
color
Color to check for a win
Color to check for a win