Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
Classes | Functions
fen_string.h File Reference
#include "chess_color.h"
#include "starting_position_type.h"
#include <string>
Include dependency graph for fen_string.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  fen_string
 Forsyth–Edwards Notation string. More...
 

Functions

fen_string create_fen_string_of_standard_starting_position (const chess_color active_player=chess_color::white)
 Create the FEN string of the standard starting position.
 
fen_string create_fen_string_with_starting_position (const starting_position_type t, const chess_color active_player=chess_color::white)
 
chess_color get_color (const fen_string &s)
 Extract the color from a FEN string.
 
fen_string get_fen_string_game_over_white_no_king () noexcept
 Get a FEN string for a game that is over: white has no king anymore.
 
fen_string get_fen_string_game_over_black_no_king () noexcept
 Get a FEN string for a game that is over: black has no king anymore.
 
fen_string get_fen_string_game_over_white_checkmate () noexcept
 Get a FEN string for a game that is over: white is in checkmate.
 
fen_string get_fen_string_game_over_black_checkmate () noexcept
 Get a FEN string for a game that is over: black is in checkmate.
 
fen_string get_fen_string_scholars_mate_0 () noexcept
 Get an FEN string for a position when doing a scholar's mate.
 
fen_string get_fen_string_scholars_mate_1 () noexcept
 Get an FEN string for a position when doing a scholar's mate.
 
fen_string get_fen_string_scholars_mate_2 () noexcept
 Get an FEN string for a position when doing a scholar's mate.
 
fen_string get_fen_string_scholars_mate_3 () noexcept
 Get an FEN string for a position when doing a scholar's mate.
 
fen_string get_fen_string_scholars_mate_4 () noexcept
 Get an FEN string for a position when doing a scholar's mate.
 
fen_string get_fen_string_scholars_mate_5 () noexcept
 Get an FEN string for a position when doing a scholar's mate.
 
fen_string get_fen_string_scholars_mate_6 () noexcept
 Get an FEN string for a position when doing a scholar's mate.
 
fen_string get_fen_string_scholars_mate_7 () noexcept
 Get an FEN string for a position when doing a scholar's mate.
 
fen_string get_fen_string_wikipedia_0 () noexcept
 Get an example FEN string from Wikipedia.
 
fen_string get_fen_string_wikipedia_1 () noexcept
 Get an example FEN string from Wikipedia.
 
fen_string get_fen_string_wikipedia_2 () noexcept
 Get an example FEN string from Wikipedia.
 
fen_string get_fen_string_wikipedia_4 () noexcept
 Get an example FEN string from Wikipedia.
 
void test_fen_string ()
 
bool operator== (const fen_string &lhs, const fen_string &rhs) noexcept
 

Function Documentation

◆ create_fen_string_of_standard_starting_position()

fen_string create_fen_string_of_standard_starting_position ( const chess_color  active_player = chess_color::white)

Create the FEN string of the standard starting position.

The active player can be changed to black. This would be equal to say that black starts.

◆ create_fen_string_with_starting_position()

fen_string create_fen_string_with_starting_position ( const starting_position_type  t,
const chess_color  active_player = chess_color::white 
)

◆ get_color()

chess_color get_color ( const fen_string s)

Extract the color from a FEN string.

◆ get_fen_string_game_over_black_checkmate()

fen_string get_fen_string_game_over_black_checkmate ( )
noexcept

Get a FEN string for a game that is over: black is in checkmate.

◆ get_fen_string_game_over_black_no_king()

fen_string get_fen_string_game_over_black_no_king ( )
noexcept

Get a FEN string for a game that is over: black has no king anymore.

◆ get_fen_string_game_over_white_checkmate()

fen_string get_fen_string_game_over_white_checkmate ( )
noexcept

Get a FEN string for a game that is over: white is in checkmate.

◆ get_fen_string_game_over_white_no_king()

fen_string get_fen_string_game_over_white_no_king ( )
noexcept

Get a FEN string for a game that is over: white has no king anymore.

◆ get_fen_string_scholars_mate_0()

fen_string get_fen_string_scholars_mate_0 ( )
noexcept

Get an FEN string for a position when doing a scholar's mate.

This is the initial position.

The scholar's mate as a PGN is get_scholars_mate_as_pgn_str} and the PGN string of the scholar's mate is similar to this:

1. e4 e5 2. Qh5 Nc6 3. Bc4 Nf6?? Qxf7# 1-0

◆ get_fen_string_scholars_mate_1()

fen_string get_fen_string_scholars_mate_1 ( )
noexcept

Get an FEN string for a position when doing a scholar's mate.

This is after 1. e4.

The scholar's mate as a PGN is get_scholars_mate_as_pgn_str} and the PGN string of the scholar's mate is similar to this:

1. e4 e5 2. Qh5 Nc6 3. Bc4 Nf6?? Qxf7# 1-0

◆ get_fen_string_scholars_mate_2()

fen_string get_fen_string_scholars_mate_2 ( )
noexcept

Get an FEN string for a position when doing a scholar's mate.

This is after 1. e4 e5.

The scholar's mate as a PGN is get_scholars_mate_as_pgn_str} and the PGN string of the scholar's mate is similar to this:

1. e4 e5 2. Qh5 Nc6 3. Bc4 Nf6?? Qxf7# 1-0

◆ get_fen_string_scholars_mate_3()

fen_string get_fen_string_scholars_mate_3 ( )
noexcept

Get an FEN string for a position when doing a scholar's mate.

This is after 1. e4 e5 2. Qh5.

The scholar's mate as a PGN is get_scholars_mate_as_pgn_str} and the PGN string of the scholar's mate is similar to this:

1. e4 e5 2. Qh5 Nc6 3. Bc4 Nf6?? Qxf7# 1-0

◆ get_fen_string_scholars_mate_4()

fen_string get_fen_string_scholars_mate_4 ( )
noexcept

Get an FEN string for a position when doing a scholar's mate.

This is after 1. e4 e5 2. Qh5 Nc6.

The scholar's mate as a PGN is get_scholars_mate_as_pgn_str} and the PGN string of the scholar's mate is similar to this:

1. e4 e5 2. Qh5 Nc6 3. Bc4 Nf6?? Qxf7# 1-0

◆ get_fen_string_scholars_mate_5()

fen_string get_fen_string_scholars_mate_5 ( )
noexcept

Get an FEN string for a position when doing a scholar's mate.

This is after 1. e4 e5 2. Qh5 Nc6 3. Bc4.

The scholar's mate as a PGN is get_scholars_mate_as_pgn_str} and the PGN string of the scholar's mate is similar to this:

1. e4 e5 2. Qh5 Nc6 3. Bc4 Nf6?? Qxf7# 1-0

◆ get_fen_string_scholars_mate_6()

fen_string get_fen_string_scholars_mate_6 ( )
noexcept

Get an FEN string for a position when doing a scholar's mate.

This is after 1. e4 e5 2. Qh5 Nc6 3. Bc4 Nf6.

The scholar's mate as a PGN is get_scholars_mate_as_pgn_str} and the PGN string of the scholar's mate is similar to this:

1. e4 e5 2. Qh5 Nc6 3. Bc4 Nf6?? Qxf7# 1-0

◆ get_fen_string_scholars_mate_7()

fen_string get_fen_string_scholars_mate_7 ( )
noexcept

Get an FEN string for a position when doing a scholar's mate.

This is after 1. e4 e5 2. Qh5 Nc6 3. Bc4 Nf6 4. Qxf7#.

The scholar's mate as a PGN is get_scholars_mate_as_pgn_str} and the PGN string of the scholar's mate is similar to this:

1. e4 e5 2. Qh5 Nc6 3. Bc4 Nf6?? Qxf7# 1-0

◆ get_fen_string_wikipedia_0()

fen_string get_fen_string_wikipedia_0 ( )
noexcept

Get an example FEN string from Wikipedia.

It is the starting position.

From \url{https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation#Examples}

◆ get_fen_string_wikipedia_1()

fen_string get_fen_string_wikipedia_1 ( )
noexcept

Get an example FEN string from Wikipedia.

It is the position after e4.

From \url{https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation#Examples}

◆ get_fen_string_wikipedia_2()

fen_string get_fen_string_wikipedia_2 ( )
noexcept

Get an example FEN string from Wikipedia.

It is the position after 1. e4. c5

From \url{https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation#Examples}

◆ get_fen_string_wikipedia_4()

fen_string get_fen_string_wikipedia_4 ( )
noexcept

Get an example FEN string from Wikipedia.

It is the position after 1. e4. c5 2. Nf3

From \url{https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation#Examples}

◆ operator==()

bool operator== ( const fen_string lhs,
const fen_string rhs 
)
noexcept

◆ test_fen_string()

void test_fen_string ( )