u-fischer / xskak

4 stars 0 forks source link

A wrong figure is moving on to d4. #6

Closed tojnya closed 2 years ago

tojnya commented 2 years ago

The wrong pawn is stepping on d4. How do I make the pawn from e5 beat the one on d4?

\documentclass[a4paper,10pt]{article}
\usepackage{xskak}
\pagestyle{empty}
\parindent=0pt

\begin{document}

\newcommand\getmovestyle[1]{%
\ifthenelse
  {\equal{#1}{N}}%knight move
  {\def\mymovestyle{[clockwise=false,style=knight]curvemove}}%
  {\ifthenelse
    {\equal{#1}{}}% castling
    {\def\mymovestyle{curvemove}}%
    {\def\mymovestyle{straightmove}}}}%
\newchessgame

\hidemoves{1.e4 e5 2. d4 d4 3.}%

%\chessboard[setfen=\xskakgetgame{initfen}]% Show me the empty board.
%% K - King, Q-Queen, R-rook, N-Knight, B-Bishop, P-pawn, 
\xskakloop{%
\getmovestyle{\xskakget{piecechar}}%
\chessboard[pgfstyle=\mymovestyle, color=blue,
markmoves=\xskakget{move}, pgfshortenend=0.3em, arrow=to, coloremph, color=red, markstyle=circle, markfield=\xskakget{movefrom},
emphfields=\xskakget{moveto}, setfen=\xskakget{nextfen}]
}% End of \xskakloop

\end{document}

image

u-fischer commented 2 years ago

You have to use the standard pgn notation exd4

\hidemoves{1.e4 e5 2. d4 exd4 3.}%