lib/pgn2fen.rb
##
# update castling options from FEN header
update castling options from FEN header
update castling options from FEN header
def update_castle_options_from_fen castle_options
      reset_castle_options(false)
      if castle_options == "-"
        return
      end
      tokens = castle_options.split("")
      tokens.each {|token|
        case token
        when "K" 
          @can_white_castle_kingside = true
        when "Q"
          @can_white_castle_queenside = true
        when "k"
          @can_black_castle_kingside = true
        when "q"
          @can_black_castle_queenside = true
        end
      }
    end
def update_castle_options_from_fen castle_options reset_castle_options ( false ) if castle_options == "-" return end tokens = castle_options . split ( "" ) tokens . each { | token | case token when "K" @can_white_castle_kingside = true when "Q" @can_white_castle_queenside = true when "k" @can_black_castle_kingside = true when "q" @can_black_castle_queenside = true end } end
update castling options from FEN header
update castling options from FEN header
castle_options
<not_specific>