lib/tak/board.rb
# Converts the current board into a bit variant in which viable
# road pieces for `color` are represented as 1s
#
# @param color [Symbol]
#
# @return [Array[Array[Integer]]]
Converts the current board into a bit variant in which viable
road pieces for `color` are represented as 1s
Converts the current board into a bit variant in which viable road pieces for ` color ` are represented as 1s
def bit_board(color)
      @board.map { |row|
        row.map { |cell| ROAD[color].include?(cell.last) ? 1 : 0 }
      }
    end
def bit_board ( color ) @board . map { | row | row . map { | cell | ROAD [ color ] . include? ( cell . last ) ? 1 : 0 } } end
Converts the current board into a bit variant in which viable
road pieces for `color` are represented as 1s
Converts the current board into a bit variant in which viable road pieces for ` color ` are represented as 1s
None
Array[Array[Integer
color
<not_specific>
<not_specific>
None