search.rb
# Creates a move object with the current irreversible game data (castling, move clock, ep square)
#   extracted from the current FEN position to serve as the "on move" for ply 0/the stump that
#   all roots stem from.  The irreversible data is typically retrieved from the current
#   move of the previous ply, which means for the 0 ply stump move, an incomplete surrogate move
#   must be made to accomidate the API which only handles single positions
Creates a move object with the current irreversible game data (castling, move clock, ep square)
extracted from the current FEN position to serve as the "on move" for ply 0/the stump that
all roots stem from.  The irreversible data is typically retrieved from the current
move of the previous ply, which means for the 0 ply stump move, an incomplete surrogate move
must be made to accomidate the API which only handles single positions
Creates a move object with the current irreversible game data ( castling move clock ep square ) extracted from the current FEN position to serve as the " on move " for ply 0 / the stump that all roots stem from . The irreversible data is typically retrieved from the current move of the previous ply which means for the 0 ply stump move an incomplete surrogate move must be made to accomidate the API which only handles single positions
def make_gamestate
    @ply, @mv_n, @root = 0, 0, 0
    @mv, @mv_score = Array.new(MV_CAPACITY) { nil }, Array.new(MV_CAPACITY) { 0 }
    @mv_idx, @on_mv = Array.new(MV_CAPACITY) { 0 }, Array.new(MAXPLY) { 0 }
    n, c = @fen.split, 0
    @mx = n[1] == 'w' ? WHITE : BLACK
    @mn = @mx + 1 & 1
    CASTLING.each { |letter, num| c += num if n[2].include?(letter) }
    @mv[0] = Move.new(nil, nil, nil, nil, @mx, c, SQ_ID.index(n[3]), n[4].to_i, n[5].to_i)
    @on_mv[0], @mv_idx[0] = 0, 0
    nil
  end
def make_gamestate @ply , @mv_n , @root = 0 , 0 , 0 @mv , @mv_score = Array . new ( MV_CAPACITY ) { nil } , Array . new ( MV_CAPACITY ) { 0 } @mv_idx , @on_mv = Array . new ( MV_CAPACITY ) { 0 } , Array . new ( MAXPLY ) { 0 } n , c = @fen . split , 0 @mx = n [ 1 ] == 'w' ? WHITE : BLACK @mn = @mx + 1 & 1 CASTLING . each { | letter , num | c += num if n [ 2 ] . include? ( letter ) } @mv [ 0 ] = Move . new ( nil , nil , nil , nil , @mx , c , SQ_ID . index ( n [ 3 ] ) , n [ 4 ] . to_i , n [ 5 ] . to_i ) @on_mv [ 0 ] , @mv_idx [ 0 ] = 0 , 0 nil end
Creates a move object with the current irreversible game data (castling, move clock, ep square)
extracted from the current FEN position to serve as the "on move" for ply 0/the stump that
all roots stem from.
Creates a move object with the current irreversible game data ( castling move clock ep square ) extracted from the current FEN position to serve as the " on move " for ply 0 / the stump that all roots stem from .