- if (initialKFile == FILE_E && initialQRFile == FILE_A && initialKRFile == FILE_H)
- {
- if (can_castle_kingside(WHITE)) fen += 'K';
- if (can_castle_queenside(WHITE)) fen += 'Q';
- if (can_castle_kingside(BLACK)) fen += 'k';
- if (can_castle_queenside(BLACK)) fen += 'q';
- }
- else
- {
- if (can_castle_kingside(WHITE))
- fen += char(toupper(file_to_char(initialKRFile)));
- if (can_castle_queenside(WHITE))
- fen += char(toupper(file_to_char(initialQRFile)));
- if (can_castle_kingside(BLACK))
- fen += file_to_char(initialKRFile);
- if (can_castle_queenside(BLACK))
- fen += file_to_char(initialQRFile);
- }
- } else
- fen += '-';
+ const bool Chess960 = initialKFile != FILE_E
+ || initialQRFile != FILE_A
+ || initialKRFile != FILE_H;