Rev 1 | Rev 44 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1 | Rev 40 | ||
---|---|---|---|
Line 1681... | Line 1681... | ||
1681 | wcscat_s (move->fen_string, WCHAR_SIZEOF (move->fen_string), L"q"); // black can castle queenside |
1681 | wcscat_s (move->fen_string, WCHAR_SIZEOF (move->fen_string), L"q"); // black can castle queenside |
1682 | } |
1682 | } |
1683 | 1683 | ||
1684 | /////////////////////////////////////////////////////////////////////////////////////////////////// |
1684 | /////////////////////////////////////////////////////////////////////////////////////////////////// |
1685 | // fourth part of the FEN notation is the optional position for a pawn that can be taken en passant |
1685 | // fourth part of the FEN notation is the optional position for a pawn that can be taken en passant |
- | 1686 | ||
- | 1687 | wcscat_s (move->fen_string, WCHAR_SIZEOF (move->fen_string), L" "); // spacer |
|
1686 | 1688 | ||
1687 | if ((move->part == PART_PAWN) // last move was a pawn |
1689 | if ((move->part == PART_PAWN) // last move was a pawn |
1688 | && (move->target[1] == move->source[1]) // pawn moved in column |
1690 | && (move->target[1] == move->source[1]) // pawn moved in column |
1689 | && (abs (move->target[0] - move->source[0]) == 2)) // pawn rushed |
1691 | && (abs (move->target[0] - move->source[0]) == 2)) // pawn rushed |
1690 | { |
1692 | { |
1691 | wcscat_s (move->fen_string, WCHAR_SIZEOF (move->fen_string), L" "); // spacer |
- | |
1692 | - | ||
1693 | // column |
1693 | // column |
1694 | if (move->source[1] == 0) wcscat_s (move->fen_string, WCHAR_SIZEOF (move->fen_string), L"a"); |
1694 | if (move->source[1] == 0) wcscat_s (move->fen_string, WCHAR_SIZEOF (move->fen_string), L"a"); |
1695 | else if (move->source[1] == 1) wcscat_s (move->fen_string, WCHAR_SIZEOF (move->fen_string), L"b"); |
1695 | else if (move->source[1] == 1) wcscat_s (move->fen_string, WCHAR_SIZEOF (move->fen_string), L"b"); |
1696 | else if (move->source[1] == 2) wcscat_s (move->fen_string, WCHAR_SIZEOF (move->fen_string), L"c"); |
1696 | else if (move->source[1] == 2) wcscat_s (move->fen_string, WCHAR_SIZEOF (move->fen_string), L"c"); |
1697 | else if (move->source[1] == 3) wcscat_s (move->fen_string, WCHAR_SIZEOF (move->fen_string), L"d"); |
1697 | else if (move->source[1] == 3) wcscat_s (move->fen_string, WCHAR_SIZEOF (move->fen_string), L"d"); |
Line 1703... | Line 1703... | ||
1703 | 1703 | ||
1704 | // line (it's the line the pawn would be on if it had made a "normal" move) |
1704 | // line (it's the line the pawn would be on if it had made a "normal" move) |
1705 | length = wcslen (move->fen_string); |
1705 | length = wcslen (move->fen_string); |
1706 | swprintf_s (&move->fen_string[length], WCHAR_SIZEOF (move->fen_string) - length, L"%d", 1 + (move->target[0] + move->source[0]) / 2); |
1706 | swprintf_s (&move->fen_string[length], WCHAR_SIZEOF (move->fen_string) - length, L"%d", 1 + (move->target[0] + move->source[0]) / 2); |
1707 | } |
1707 | } |
- | 1708 | else |
|
- | 1709 | wcscat_s (move->fen_string, WCHAR_SIZEOF (move->fen_string), L"-"); // last move was not a pawn rush |
|
1708 | 1710 | ||
1709 | return; // finished |
1711 | return; // finished |
1710 | } |
1712 | } |
1711 | 1713 | ||
1712 | 1714 |