OpenLLM-France/wikimedia huggingface dataset:
# Two Knights Defence
### 7 ... bxc6
## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
    1.e4 e5 2.Nf3 Nc6 3.Bc4 Nf6 4.Ng5 d5 5.exd5 Na5 6.Bb5+ c6 7. dxc6 bxc6
| 7 | 8 |
| dxc6 bxc6 | Ba4 h6 |
| ... ... | Bd3 - |
| ... ... | Qf3 - |
| ... ... | Be2 - |

## Statistics

Estimated next move likelihood Be2 51%, Qf3 45%, Bd3 3.5%, Ba4 0.3%, Bf1 0.2%
When contributing to this Wikibook, please follow the Conventions for organization.
# Two Knights Defence
### 6. Bb5+
## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
    1.e4 e5 2.Nf3 Nc6 3.Bc4 Nf6 4.Ng5 d5 5.exd5 Na5 6.Bb5+
| 5 | 6 | 7 |
| exd5 Na5 | Bb5+ Bd7 | Qe2 Bd6 |
| ... ... | ... c6 | dxc6 bxc6 |

## Statistics

Estimated next move likelihood c6 87.3%, Bd7 12.7%
When contributing to this Wikibook, please follow the Conventions for organization.
# Two Knights Defence
### 4...d5

    This is the most commonly played move in the position.
    It blocks White's attempt to win the f7 pawn and can lead to black sacrificing a pawn in return for space and development.

## Statistics

Estimated next move popularity exd5 100%

## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
    1.e4 e5 2.Nf3 Nc6 3.Bc4 Nf6 4.Ng5 d5
| 4 | 5 |
| Ng5 d5 | exd5 - |
When contributing to this Wikibook, please follow the Conventions for organization.

## References

* Kasparov, Garry, & Keene, Raymond 1989 Batsford chess openings 2. ISBN 0-8050-3409-9.
# Two Knights Defence

6 ... Bd7.

# Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
    1.e4 e5 2.Nf3 Nc6 3.Bc4 Nf6 4.Ng5 d5 5.exd5 Na5 6.Bb5+
| | 6 | 7 | 8 | 9 | 10 |
| 1 | ... Bd7 | Bxd7 Qxd7 | O-O h6 | = |
| 2 | ... ... | Qe2 Bd6 | Nc3 O-O | Bxd7 Qxd7 | O-O - | +/= |
| 3 | ... ... | ... ... | ... c6 | dxc6 Nxc6 | ∞ |

## Statistics

Estimated next move likelihood Qe2 93%, Bxd7 5%, Be2 2%
When contributing to this Wikibook, please follow the Conventions for organization.
# Two Knights Defence
### 8. Ba4
## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
    1.e4 e5 2.Nf3 Nc6 3.Bc4 Nf6 4.Ng5 d5 5.exd5 Na5 6.Bb5+ c6 7. dxc6 bxc6
| 8 | 9 |
| Ba4 h6 | Nf3 e4 |
When contributing to this Wikibook, please follow the Conventions for organization.
# Two Knights Defence
### 5. exd5

    An automatic move as other moves lose material. Black has a selection of interesting moves leading to diverse tactical positions.

## Statistics

Estimated next move likelihood
Na5 69.1%, Nd4 15.3%, b5 13.2%, Nd5 1.6%, Nb4 0.8%

## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation.
1.e4 e5 2.Nf3 Nc6 3.Bc4 Nf6 4.Ng5 d5 5. exd5
| | 5 | 6 | 7 | 8 |
| Main Line | exd5 Na5 | Bb5+ c6 | dxc6 bxc6 | Be2 h6 | ∞ |
| Bogoljubov Variation | ... ... | ... ... | ... ... | Qf3?! Rb8 | ∞ |
| Ulvestad Variation | ... b5 | Bf1 h6 | Nxf7 Kxf7 | dxc6 Bc5 | += |
| Fritz Variation | ... Nd4 | c3 b5 | Bf1 Nxd5 | Ne4 Qh4 | += |
| Lolli Variation | ... Nxd5!? | d4 Bb4+ | c3 Be7 | Nxf7 Kxf7 | += |
| Fried Liver Attack | ... ... | Nxf7!! Kxf7 | Qf3! Ke6 | Nc3 Nb4 | ∞ |
When contributing to this Wikibook, please follow the Conventions for organization.

## References

* Kasparov, Garry, & Keene, Raymond 1989 Batsford chess openings 2. ISBN 0-8050-3409-9.
* Nunn's Chess Openings. 1999. John Nunn (Editor), Graham Burgess, John Emms, Joe Gallagher. ISBN 1-8574-4221-0.
# C++ Language/Indirection/TypedNull

The traditional NULL macro was really just a int with value 0. This is commonly used as a special value assigned to a pointer variable, having the semantic meaning of "not pointing at anything" (because computers will never try to use their memory at address 0).
Modern C++ uses nullptr instead of NULL, because nullptr has a dedicated std::nullptr_t type.
Additional information about nullptr
# C++ Language/Indirection/SmartPointers/UniqueOwnership

If a smart pointer's memory should be "owned" by exactly one client, use std::unique_ptr<> for the smart pointer type.
Additional information about unique_ptr (includes interactive examples)
# C++ Language/Namespace/NamedAndUnnamed

An unnamed namespace {...} is a way to restrict the visibility of a global variable to one single file.
If you dislike the name that somebody gave to a namespace, namespace NRNew = NROld; creates your own alias for it.
Additional information about unnamed namespaces (includes interactive examples)
# C++ Language/Indirection/SmartPointers/TemplateParameter

You can access a smart pointer's template-parameter by std::unique_ptr<int>::element_type.
Additional information about accessing a smart pointer's template-parameter
# C++ Language/Namespace/NamespaceShortcuts

Anything defined with namespace NRNamespace {...} will require additional qualification (writing variable giVarB as NRNamespace::giVarB) unless you have requested to skip that requirement on a case-by-case basis (programming using NRNamespace::giVarB;).
Or, the qualification requirement could be skipped for an entire namespace all at once.
Additional information about namespace shortcuts (includes interactive examples)
# C++ Language/Namespace

Anything defined with namespace NRNamespace {...} will require additional qualification (writing variable giVar as NRNamespace::giVar).
* Namespace Shortcuts
* Nesting
* Splitting across Files
* Named and Unnamed
# C++ Language/Namespace/Nesting

Namespaces can be nested, with the qualification programmed as NROuter::NRInner::giVar.
Additional information about nesting namespaces
# Chess Variants/Alice Chess

| A | A | A | B |
Starting position of Alice chess :

## Introduction

Alice chess is a variant where pieces teleport between two boards.

## History

Alice chess was created by prolific chess variant creator V. R. Parton in 1953. The variant is inspired by the Lewis Carroll book Through the Looking-Glass, the sequel to Alice's Adventures in Wonderland. The book involves Alice stepping through a looking-glass and entering a fantastical world, which translates into the variant's main mechanic. Indeed, the variant itself is named after Alice.

## Rules

| A | A | A | B |
Position after 1.Nf3 e6 2.Ne5 Bc5 :
As already stated Alice chess is played with two boards, designated with the letters A and B, laid next to each other at game start. All of the pieces begin the game on board A.
On each turn, a player may choose to move a piece on either board A or B. The piece all retain their typical moves, but once a piece completes its move, it goes "through the looking-glass" and is teleported to the corresponding square on the opposite board. So for example, if a white knight moved from f1 to g3 on board A, would then be teleported to the g3 square on board B.
There are two basic stipulations concerning each move:
* The move must be legal on the board where it is played.
* The corresponding square on the opposite board cannot be occupied by another piece, friendly or hostile.
Captures may only be played on the same board that the piece is moving on, since the teleport happens after the piece's move is complete.
When moving on one board a piece is allowed to pass over squares that are occupied by pieces on the other board. For example, in the diagram at left, after White moved Black would be allowed to play 3... Bg1, despite there being a white pawn on f2 on board A, since the move is legal on board B and g1 on square A is unoccupied.
The king is not allowed to make a move on one board, if his teleport to the other board would land him in check. He is also not allowed to use the teleport to escape check - he must move out of check before the teleport. Additionally, you may not make a capture if your piece's teleport would expose your king to check.
You are allowed to escape check by moving a piece on the other board so that its teleport blocks the check.
Castling is permitted as in standard chess, with both the king and rook teleporting to the other board.
There is no en passant.

## Sub-variants

* In Looking-glass Alice chess, the white pieces start on board A as usual, but the black pieces start on board B.
* Ms. Alice chess allows a player to make a null move, which simply teleports a piece to the other board without moving it.
* In O'Donohue chess you are allowed to move a piece to a square occupied on the other board - in whcih case the teleport portion of the move is skipped.
* As its name suggests, Three-board Alice chess uses three boards instead of two. You are allowed to selected which board your piece teleports to.
# Chess Variants/Almost Chess

| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |

## Introduction

Almost Chess is a variant that replaces each player's queen with a chancellor, a piece that can move as either a rook or a knight.

## History

Almost chess was created in 1977 by chess variant creator Ralph Betza. The game is almost like chess, hence its name. It was featured in the magazine of the correspondence games club Knights of the Square Table, which mainly played chess variants.

## Rules

As already said, almost chess is played exactly like the standard game, the only difference being that each player's queen is replaced with a chancellor, a piece that combines the powers of the rook and the knight. The chancellor may slide along ranks or files like a rook, or it may hop in an L-shape like a knight, but not both simultaneously.
The replacement of queens with chancellors imparts a radical change to the nature of the variant, despite the two pieces having approximately equal strengths. For example, bishops are stronger and knights are weaker. Betza commented that almost chess is a good introductory chess variant for players, due to its great similarity to standard chess and the naturalness of the change from queen to chancellor.
| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |

## Sub-variants

* Sort of almost chess, created in 1994, only replaces one of the queens with a chancellor.
# Chess Variants/Avalanche Chess
## Introduction

Avalanche Chess is a variant where each player moves their opponent's pawns.

## History

Avalanche chess was created in the 1977 by chess variant designer Ralph Betza.

## Rules

Avalanche chess is played like the standard game, with an additional rule: after a player has moved one of their pieces, they must move one of their opponent's pawns one square forward. If the opponent has no pawns left or the opponent's pawns have no legal moves, than that part of the turn is skipped.
Capturing with an opponent's pawn is not allowed, and a player cannot use a pawn advanced by the opponent to capture en passant.
A player may use either a normal move or an opponent pawn move to give check, and if a player is in check they must use their normal move to escape it. It is forbidden to place one's own king in check, even if there is an opponent pawn move that could block it.
If a pawn is advanced to the promotion rank, the owner of the pawn chooses the piece to promote to, regardless of who moved it there.
If a player moves an opponent's pawn to promotion, and the opponent chooses a piece that places the player's king in check, that is checkmate and the opponent wins the game.
If a player's only legal opponent pawn moves place their king in check, the opponent wins even if the player check(mated) their opponent's king on their turn.

## Sub-variants

This chess variant does not not have any notable sub-variants.
# Chess Variants/Anti-King Chess

| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |
| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |

## Introduction

Anti-King Chess is a variant that adds a piece known as the "anti-king" to the chessboard. There are two versions of the variant, named with the Roman numerals I and II.

## History

Both versions of Anti-King chess were created by chess variant creator Peter Aronson in 2002, inspired by losing chess. Inspired by previous variants that simply replaced the king with an anti-king, Aronson got the idea to have both the king and anti-king on the board to add dynamic tension to the game.

## Rules

Both versions of Anti-King chess play mostly like the standard game, with the addition of the anti-king to the typical set of pieces.
The anti-king (reresented by an inverted king) moves exactly like a standard king. The difference between the two is that the anti-king must be kept attacked by enemy pieces at all times, and the anti-king is considerd to be in "anti-check" if it not attacked by an opposing piece. If a player's anti-king is in anti-check and the player is unable to move the anti-king to a square where it is attacked by an enemy piece that anti-king is in "anti-checkmate" and its owner has lost the game.
Because of the unique nature of the anti-king, it cannot capture or be captured by enemy pieces. This means that the anti-king cannot deliver check to the enemy king, and likewise the enemy king cannot attack the anti-king. However the anti-king does possess the ability to capture friendly pieces.
Anti-King Chess I uses several additional rules:
* The pawns are replaced with Berolina pawns, which move diagonally and capture forward. See the Berolina chess page for more information. Unlike in Berolina chess the Berolina pawns in this game do not get the options of a first-move double-step (and hence, there is no en passant).
* There is no castling. Instaed, if the king or anti-king have not yet moved in the game they may make their first move as a knight's leap to an empty square, provided it is not attacked (for the king) or attacked by the enemy (for the anti-king).

## Sub-variants

This chess variant does not have any notable sub-variants.
# Chess Variants/Atomic Chess
## Introduction

Atomic Chess is an explosive variant that changes how captures work - all captures result in an explosion that removes nearby pieces from play.

## History

Atomic chess was introduced in 1995 by the German Internet Chess Server (GICS), based on rules a GICS member collected from friends. From there it spread to other smaller chess servers before being added to Lichess.org in 2015 and Chess.com in late 2020.

## Rules

In normal chess, when a piece makes a capture it moves to the square the enemy piece was on, and the enemy piece is removed from the board. However, in atomic chess when a piece makes a capture, an explosion occurs which covers a three-by-three radius of squares around the square where the capturing piece lands. Any non-pawn pieces caught in the radius of the explosion are removed from the board. The capturing piece is also removed.
Pawns are only removed if they are involved directly in a capture.
If an en passant capture takes place, the centre of the explosion is on the square where the capturing pawn would have otherwise landed.
A player may never make a capture that would result in their own king being blown up in the resulting explosion. As a result, kings are not allowed to make captures in atomic chess, and kings may position themselves on adjacent squares. Also, a player may not make a capture if the resulting explosion would expose their king to check.
If a player's king is blown up, they automatically lose the game.
A player may respond to check by making a capture that blows up the enemy king, if such a capture is available.

## Sub-variants

This chess variant does not not have any notable sub-variants.
# C++ Programming/Code/Standard C Library/Functions/fputc
#### fputc

| Syntax | #include <cstdio> int fputc( int ch, FILE *stream ); |
The function fputc writes the given character ch to the given output stream. The return value is the character, unless there is an error, in which case the return value is EOF.

##### Related topics

    fgetc - fopen - fprintf - fread - fwrite - getc - getchar - putc
# C++ Programming/Code/Standard C Library/Functions/fputs
#### fputs

| Syntax | #include <cstdio> int fputs( const char *str, FILE *stream ); |
The fputs function writes an array of characters pointed to by str to the given output stream. The return value is non-negative on success, and EOF on failure.

##### Related topics

    fgets - fprintf - fscanf - gets - getc - puts
# C++ Programming/Code/Standard C Library/Functions/free
## free

| Syntax | #include <cstdlib> void free( void *p); |
The function free releases a previously allocated block from a call to calloc, malloc, or realloc.

### Related topics

    calloc - malloc - realloc
# C++ Programming/Code/Standard C Library/Functions/fprintf
#### fprintf

| Syntax | #include <cstdio> int fprintf( FILE *stream, const char *format, ... ); |
The fprintf function sends information (the arguments) according to the specified format to the file indicated by stream. fprintf works just like printf as far as the format goes. The return value of fprintf is the number of characters outputted, or a negative number if an error occurs. An example:

##### Related topics

    fputc - fputs - fscanf - printf - sprintf
# C++ Programming/Code/Standard C Library/Functions/floor
#### floor

| Syntax | #include <cmath> double floor( double arg ); |
The function floor returns the largest integer value not greater than arg.
would result in x being set to 6 (double 6.0).
would result in x being set to -7 (double -7.0).

##### Related topics

    ceil - fmod
# C++ Programming/Code/Standard C Library/Functions/fmod
#### fmod

| Syntax | #include <cmath> double fmod( double x, double y ); |
The fmod function returns the remainder of x/y.

##### Related topics

    ceil - fabs - floor
# C++ Programming/Code/Standard C Library/Functions/fopen
## fopen

| Syntax | #include <cstdio> FILE *fopen( const char *fname, const char *mode ); |
The fopen function opens a file indicated by fname and returns a stream associated with that file. If there is an error, fopen returns NULL. mode is used to determine how the file will be treated (i.e. for input, output, etc.)
The mode contains up to three characters. The first character is either "r", "w", or "a", which indicates how the file is opened. A file opened for reading starts allows input from the beginning of the file. For writing, the file is erased. For appending, the file is kept and writing to the file will start at the end. The second character is "b", is an optional flag that opens the file as binary - omitting any conversions from different formats of text. The third character "+" is an optional flag that allows read and write operations on the file (but the file itself is opened in the same way.
| Mode | Meaning | Mode | Meaning |
| "r" | Open a text file for reading | "r+" | Open a text file for read/write |
| "w" | Create a text file for writing | "w+" | Create a text file for read/write |
| "a" | Append to a text file | "a+" | Open a text file for read/write |
| "rb" | Open a binary file for reading | "rb+" | Open a binary file for read/write |
| "wb" | Create a binary file for writing | "wb+" | Create a binary file for read/write |
| "ab" | Append to a binary file | "ab+" | Open a binary file for read/write |
An example:

### Related topics

    fclose - fflush - fgetc - fputc - fread - freopen - fseek - fwrite - getc - getchar - setbuf
# C++ Programming/Code/Standard C Library/Functions/fread
#### fread

| Syntax | #include <cstdio> int fread( void *buffer, size_t size, size_t num, FILE *stream ); |
The function fread reads num number of objects (where each object is size bytes) and places them into the array pointed to by buffer. The data comes from the given input stream. The return value of the function is the number of things read. You can use feof or ferror to figure out if an error occurs.

##### Related topics

    fflush - fgetc - fopen - fputc - fscanf - fwrite - getc
# C++ Programming/Code/Standard C Library/Functions/freopen
#### freopen

| Syntax | #include <cstdio> FILE *freopen( const char *fname, const char *mode, FILE *stream ); |
The freopen function is used to reassign an existing stream to a different file and mode. After a call to this function, the given file stream will refer to fname with access given by mode. The return value of freopen is the new stream, or NULL if there is an error.

##### Related topics

    fclose - fopen
# C++ Programming/Code/Standard C Library/Functions/frexp
#### frexp

| Syntax | #include <cmath> double frexp( double num, int* exp ); |
The function frexp is used to decompose num into two parts: a mantissa between 0.5 and 1 (returned by the function) and an exponent returned as exp. Scientific notation works like this:

##### Related topics

    ldexp - modf
# Chess Variants/Maharajah and the Sepoys

| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |

## Introduction

Maharajah and the Sepoys is an asymmetric variant from India that pits a powerful white king (the titular Maharajah) against the standard chess army (the Sepoys).

## History

It is believed that a early version of this variant was played in India in the 12th century CE, but fell dormant shortly after. It was revived in 1871 by Kridakaushalya, an Indian games encyclopedia. The variant was first described in the Western world in 1892 by English author and architect Edward Falkener, who also gave the variant its name.
For reference, "maharajah" was a Sanskrit term for an Indian prince, and "sepoys" were the Indian soldiers recruited by the British to maintain their control over the subcontinent.
This variant has been solved - with perfect play from both sides the variant will end in a guaranteed win for the Sepoys.

## Rules

The Sepoys are given the standard chess army, with one exception - the pawns are all replaced with "weak pawns", which cannot promote. If a black weak pawn reaches the first rank, it simply stands there as an obstacle until captured.
The White player is only given one piece, the titular Maharajah, which possesses the combined powers of the queen and the knight. The maharajah is also royal, so it must move out of check if attacked. It may pass through attacked squares to land on a safe square.
The goal for both players is to checkmate the other's royal piece.

## Sub-variants

This chess variant does not have any notable sub-variants.