A little proposal for promotion moves notation

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

New and improved

Post by sje »

New and improved with output for double/discovered check/checkmate and stalemate:
[d]4k3/8/4N3/8/8/8/8/2RRRQK1 w - - 0 1[/d]

Code: Select all

[] sf 4k3/8/4N3/8/8/8/8/2RRRQK1 w - - 0 1
[] dm
Kf2 Kg2 Kh1 Kh2 Nc5# Nc7# Nd4+ Nd8# Nf4+ Nf8# Ng5# Ng7# Qa6 Qb5+ Qc4 Qd3 Qe2 Qf2 Qf3 Qf4 Qf5 Qf6 Qf7+ Qf8# Qg2 Qh3 Ra1 Rb1 Rc2 Rc3 Rc4 Rc5 Rc6 Rc7 Rc8+ Rd2 Rd3 Rd4 Rd5 Rd6 Rd7 Rd8+ Re2 Re3 Re4 Re5
[] dmverb
The white king at square g1 moves to square f2.
The white king at square g1 moves to square g2.
The white king at square g1 moves to square h1.
The white king at square g1 moves to square h2.
The white knight at square e6 moves to square c5 giving discovered checkmate.
The white knight at square e6 moves to square c7 giving double checkmate.
The white knight at square e6 moves to square d4 giving discovered check.
The white knight at square e6 moves to square d8 giving discovered checkmate.
The white knight at square e6 moves to square f4 giving discovered check.
The white knight at square e6 moves to square f8 giving discovered checkmate.
The white knight at square e6 moves to square g5 giving discovered checkmate.
The white knight at square e6 moves to square g7 giving double checkmate.
The white queen at square f1 moves to square a6.
The white queen at square f1 moves to square b5 giving check.
The white queen at square f1 moves to square c4.
The white queen at square f1 moves to square d3.
The white queen at square f1 moves to square e2.
The white queen at square f1 moves to square f2.
The white queen at square f1 moves to square f3.
The white queen at square f1 moves to square f4.
The white queen at square f1 moves to square f5.
The white queen at square f1 moves to square f6 giving stalemate.
The white queen at square f1 moves to square f7 giving check.
The white queen at square f1 moves to square f8 giving checkmate.
The white queen at square f1 moves to square g2.
The white queen at square f1 moves to square h3.
The white rook at square c1 moves to square a1.
The white rook at square c1 moves to square b1.
The white rook at square c1 moves to square c2.
The white rook at square c1 moves to square c3.
The white rook at square c1 moves to square c4.
The white rook at square c1 moves to square c5.
The white rook at square c1 moves to square c6.
The white rook at square c1 moves to square c7 giving stalemate.
The white rook at square c1 moves to square c8 giving check.
The white rook at square d1 moves to square d2.
The white rook at square d1 moves to square d3.
The white rook at square d1 moves to square d4.
The white rook at square d1 moves to square d5.
The white rook at square d1 moves to square d6.
The white rook at square d1 moves to square d7.
The white rook at square d1 moves to square d8 giving check.
The white rook at square e1 moves to square e2.
The white rook at square e1 moves to square e3.
The white rook at square e1 moves to square e4.
The white rook at square e1 moves to square e5.
The code is simple; the only tricky part is to know not to call any of the move marking routines when they are not needed.

Updated move flag enumeration:

Code: Select all

// Move flags

typedef enum
{
  MfNil = -1,
  MfAndf,  // Algebraic notation disambiguation: file letter
  MfAndr,  // Algebraic notation disambiguation: rank number
  MfChck,  // Check (evil king attacked once/twice)
  MfDbch,  // Double check (evil king attacked twice)
  MfDraw,  // Immediate draw (fiftymoves/insufficient/repetition/stalemate)
  MfDsch,  // Discovered check (moving man does not attack evil king)
  MfMate,  // No moves (checkmate/stalemate)
  MfNote,  // Notated (SAN can be generated correctly)
  MfNull,  // Null
} Mf;