lib/pgn2fen.rb
##
# get FEN castle text based on castling availability
get FEN castle text based on castling availability
get FEN castle text based on castling availability
def fen_castle_text
      text = ""
      if @can_white_castle_kingside; text.concat("K"); end
      if @can_white_castle_queenside; text.concat("Q"); end
      if @can_black_castle_kingside; text.concat("k"); end
      if @can_black_castle_queenside; text.concat("q"); end
      if text.empty?; text = "-"; end
      text
    end
def fen_castle_text text = "" if @can_white_castle_kingside ; text . concat ( "K" ) ; end if @can_white_castle_queenside ; text . concat ( "Q" ) ; end if @can_black_castle_kingside ; text . concat ( "k" ) ; end if @can_black_castle_queenside ; text . concat ( "q" ) ; end if text . empty? ; text = "-" ; end text end
get FEN castle text based on castling availability
get FEN castle text based on castling availability