Minor cleanup

This commit is contained in:
Mark 2023-12-06 14:03:22 -08:00
parent a48e6f5d15
commit e4ebdac31a
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
7 changed files with 112 additions and 120 deletions

View File

@ -0,0 +1,37 @@
\setchessboard{
showmover=false,
borderwidth=0.5mm,
label=false,
labelleft=true,
labelbottom=true,
normalboard,
hlabelformat=\arabic{ranklabel},
vlabelformat=\Alph{filelabel}
}
\long\def\manyboards#1{
\if@solutions
\chessboard[setpieces = {#1}]
\hfill
\chessboard[setpieces = {#1}]
\else
\vfill
\chessboard[setpieces = {#1}]
\hfill
\chessboard[setpieces = {#1}]
\vfill
\chessboard[setpieces = {#1}]
\hfill
\chessboard[setpieces = {#1}]
\fi
}
\makeatletter
\cbDefineNewPiece{white}{U}
{\raisebox{1.75mm}{\cfss@whitepiececolor
$\odot$}}
{\BlackEmptySquare%
\makebox[0pt][r]{\cfss@whitepiececolor
\raisebox{1.75mm}{\makebox[1em]{$\odot$}}}}
\makeatother

View File

@ -13,79 +13,15 @@
\usepackage{afterpage} \usepackage{afterpage}
\usepackage[hang]{footmisc} \usepackage[hang]{footmisc}
% Modify default tab positions for better stars
% Modify default tab positions for better stars in score decomposition
\TabPositions{1.2cm, 2cm, 3cm, 4cm, 5cm, 6cm, 7cm, 8cm} \TabPositions{1.2cm, 2cm, 3cm, 4cm, 5cm, 6cm, 7cm, 8cm}
\input{chess-setup}
\input{stars}
\def\nstars#1#2{%
\ifnum #2 > 0%
\def\starcolor{\color{#1}}%
\count255=1%
\loop{%
\starcolor $\bigstar$%
}%
\ifnum \count255 < #2%
\advance\count255 by 1%
\repeat%
\fi%
}
\def\startimes#1{
{\color{ogrape} $\bigstar \times #1$}
}
\def\starvalue#1{
\stars{#1}{#1} \par
\vspace{1mm}
}
\def\difficulty#1#2{
\textbf{Difficulty:} \stars{#1}{#2} \par
\vspace{1mm}
}
\def\difficultynote#1#2#3{
\textbf{Difficulty:} \stars{#1}{#2} ~ #3\par
\vspace{1mm}
}
\setchessboard{
showmover=false,
borderwidth=0.5mm,
label=false,
labelleft=true,
labelbottom=true,
normalboard,
hlabelformat=\arabic{ranklabel},
vlabelformat=\Alph{filelabel}
}
\makeatletter \makeatletter
\cbDefineNewPiece{white}{U}
{\raisebox{1.75mm}{\cfss@whitepiececolor
$\odot$}}
{\BlackEmptySquare%
\makebox[0pt][r]{\cfss@whitepiececolor
\raisebox{1.75mm}{\makebox[1em]{$\odot$}}}}
\long\def\manyboards#1{
\if@solutions
\chessboard[setpieces = {#1}]
\hfill
\chessboard[setpieces = {#1}]
\else
\vfill
\chessboard[setpieces = {#1}]
\hfill
\chessboard[setpieces = {#1}]
\vfill
\chessboard[setpieces = {#1}]
\hfill
\chessboard[setpieces = {#1}]
\fi
}
\@makeORMCbox{@hintlist} \@makeORMCbox{@hintlist}
{Score Decomposition:} {Score Decomposition:}
@ -100,34 +36,20 @@ $\odot$}}
\end{@hintlist} \end{@hintlist}
} }
\long\def\hintcontent#1{
\def\threestars#1#2#3{
\nstars{white}{#1}\nstars{ogrape}{#2}\nstars{white}{#3}
}
\def\onestars#1{
\nstars{ogrape}{#1}
}
\long\def\hintcontentnew#1{
\if@solutions \if@solutions
#1 \par #1 \par
\vspace{2mm} \vspace{2mm}
\fi \fi
} }
\long\def\hintcontent#1#2#3{
\if@solutions
\nstars{white}{#1}\nstars{ogrape}{#2} \par #3
\vspace{2mm}
\else
\nstars{white}{#1}\nstars{ogrape}{#2}
\fi\par
}
\makeatother \makeatother
\uptitlel{Advanced 2} \uptitlel{Advanced 2}
\uptitler{Fall 2023} \uptitler{Fall 2023}
\title{Retrograde Analysis} \title{Retrograde Analysis}

View File

@ -7,7 +7,7 @@ An example is below.
\vspace{4mm} \vspace{4mm}
\generic{Problem $0$:} \generic{Problem $0$:}
\starvalue{4} \onestars{4}
This is a problem that has two parts. \par This is a problem that has two parts. \par
If you solve the problem on your own, your team gets four points. \par If you solve the problem on your own, your team gets four points. \par
@ -27,12 +27,12 @@ There are two ways you can ask for assistance: \par
\begin{hintlist} \begin{hintlist}
Part 1: \tab\threestars{0}{1}{3} \par Part 1: \tab\threestars{0}{1}{3} \par
\hintcontentnew{ \hintcontent{
This is a hint. Only instructors see this. This is a hint. Only instructors see this.
} }
Part 2: \tab\threestars{1}{2}{1} \par Part 2: \tab\threestars{1}{2}{1} \par
\hintcontentnew{ \hintcontent{
This is another hint. This is another hint.
} }

View File

@ -5,7 +5,7 @@
% Sherlock, A little exercise % Sherlock, A little exercise
\problem{A little exercise} \problem{A little exercise}
%\difficulty{1}{5} %\difficulty{1}{5}
\starvalue{3} \onestars{3}
Black has just moved in the game below. White started on the south side of the board.\par Black has just moved in the game below. White started on the south side of the board.\par
What was Black's last move, and what was White's last move? \par What was Black's last move, and what was White's last move? \par
@ -18,12 +18,12 @@ What was Black's last move, and what was White's last move? \par
\begin{hintlist} \begin{hintlist}
Part 1: \tab\threestars{0}{1}{2} \par Part 1: \tab\threestars{0}{1}{2} \par
\hintcontentnew{ \hintcontent{
What was Black's last move? What White do to make this happen? What was Black's last move? What White do to make this happen?
} }
Part 2: \tab\threestars{1}{1}{1} \par Part 2: \tab\threestars{1}{1}{1} \par
\hintcontentnew{ \hintcontent{
White uncovered a check. What piece did Black capture? White uncovered a check. What piece did Black capture?
} }
@ -67,7 +67,7 @@ What was Black's last move, and what was White's last move? \par
% Sherlock, Which color? % Sherlock, Which color?
\problem{Which color?} \problem{Which color?}
%\difficulty{2}{5} %\difficulty{2}{5}
\starvalue{4} \onestars{4}
In the game below, no pieces have moved from a black square to a white square, or from a white square to a black square. In the game below, no pieces have moved from a black square to a white square, or from a white square to a black square.
There is a pawn at G3. What color is it? \par There is a pawn at G3. What color is it? \par
As before, White started on the bottom of the board. As before, White started on the bottom of the board.
@ -82,12 +82,12 @@ As before, White started on the bottom of the board.
\begin{hintlist} \begin{hintlist}
Part 1: \tab\threestars{0}{1}{3} \par Part 1: \tab\threestars{0}{1}{3} \par
\hintcontentnew{ \hintcontent{
How did the white king get off E1? It must have castled! How did the white king get off E1? It must have castled!
} }
Part 2: \tab\threestars{1}{1}{2} \par Part 2: \tab\threestars{1}{1}{2} \par
\hintcontentnew{ \hintcontent{
It castled kingside (how do we know?). Now, how did it get off G1? It castled kingside (how do we know?). Now, how did it get off G1?
} }
@ -124,7 +124,7 @@ As before, White started on the bottom of the board.
% Arabian Knights 2 % Arabian Knights 2
\problem{Invisible, but not invincible} \problem{Invisible, but not invincible}
%\difficulty{2}{5} %\difficulty{2}{5}
\starvalue{4} \onestars{4}
The black king has turned himself invisible. Unfortunately, his position is hopeless. \par The black king has turned himself invisible. Unfortunately, his position is hopeless. \par
Mate the king in one move. \par Mate the king in one move. \par
@ -137,7 +137,7 @@ Mate the king in one move. \par
\begin{hintlist} \begin{hintlist}
Part 1: \tab\threestars{0}{1}{3} \par Part 1: \tab\threestars{0}{1}{3} \par
\hintcontentnew{Don't forget about promotion.} \hintcontent{Don't forget about promotion.}
\vspace{2mm} \vspace{2mm}
Done: \tab\threestars{1}{3}{0} Done: \tab\threestars{1}{3}{0}
@ -166,7 +166,7 @@ Mate the king in one move. \par
% Sherlock, a question of survival % Sherlock, a question of survival
\problem{An empty board} \problem{An empty board}
%\difficulty{2}{5} %\difficulty{2}{5}
\starvalue{4} \onestars{4}
In the game below, no pieces have moved from a black square to a white square, or from a white square to a black square. In the game below, no pieces have moved from a black square to a white square, or from a white square to a black square.
There is one more piece on the board, which isn't shown. What color square does it stand on? \par There is one more piece on the board, which isn't shown. What color square does it stand on? \par
@ -179,7 +179,7 @@ There is one more piece on the board, which isn't shown. What color square does
\begin{hintlist} \begin{hintlist}
Part 1: \tab\threestars{0}{1}{3} \par Part 1: \tab\threestars{0}{1}{3} \par
\hintcontentnew{Which piece performed the last capture on a black square?} \hintcontent{Which piece performed the last capture on a black square?}
\vspace{2mm} \vspace{2mm}
Done: \tab\threestars{1}{3}{0} Done: \tab\threestars{1}{3}{0}
@ -204,7 +204,7 @@ There is one more piece on the board, which isn't shown. What color square does
% Sherlock, another monochromatic % Sherlock, another monochromatic
\problem{The knight's grave} \problem{The knight's grave}
%\difficulty{3}{5} %\difficulty{3}{5}
\starvalue{4} \onestars{4}
In the game below, no pieces have moved from a black square to a white square, or from a white square to a black square. In the game below, no pieces have moved from a black square to a white square, or from a white square to a black square.
The white king has made less than fourteen moves. \par The white king has made less than fourteen moves. \par
Use this information to show that a pawn was promoted. \par Use this information to show that a pawn was promoted. \par
@ -217,7 +217,7 @@ Use this information to show that a pawn was promoted. \par
\begin{hintlist} \begin{hintlist}
Part 1: \tab\threestars{0}{1}{3} \par Part 1: \tab\threestars{0}{1}{3} \par
\hintcontentnew{ \hintcontent{
Who took the knights? Only one of them is interesting---most are easy to account for. Who took the knights? Only one of them is interesting---most are easy to account for.
} }
\vspace{2mm} \vspace{2mm}
@ -249,7 +249,7 @@ Use this information to show that a pawn was promoted. \par
% Arabian Knights, intro (given with solution) % Arabian Knights, intro (given with solution)
\problem{Promotion?} \problem{Promotion?}
%\difficulty{2}{5} %\difficulty{2}{5}
\starvalue{6} \onestars{6}
It is White's move. Have there been any promotions this game? \par It is White's move. Have there been any promotions this game? \par
@ -260,7 +260,7 @@ It is White's move. Have there been any promotions this game? \par
\begin{hintlist} \begin{hintlist}
Part 1: \tab\threestars{0}{4}{2} \par Part 1: \tab\threestars{0}{4}{2} \par
\hintcontentnew{ \hintcontent{
The black king must have moved from F1. (Why not G1?) \par The black king must have moved from F1. (Why not G1?) \par
This would be impossible if something hadn't blocked check from the white rook. This would be impossible if something hadn't blocked check from the white rook.
} }
@ -296,7 +296,7 @@ It is White's move. Have there been any promotions this game? \par
% Sherlock Holmes, two bagatelles (1) % Sherlock Holmes, two bagatelles (1)
\problem{Whodunit} \problem{Whodunit}
%\difficulty{2}{5} %\difficulty{2}{5}
\starvalue{6} \onestars{6}
It is Black's move. Can Black castle? \par It is Black's move. Can Black castle? \par
\hint{Remember the rules of chess: you may not castle if you've moved your rook.} \hint{Remember the rules of chess: you may not castle if you've moved your rook.}
@ -312,7 +312,7 @@ It is Black's move. Can Black castle? \par
\begin{hintlist} \begin{hintlist}
Part 1: \tab\threestars{0}{4}{2} \par Part 1: \tab\threestars{0}{4}{2} \par
\hintcontentnew{ \hintcontent{
Black captured a knight on his last move. \par Black captured a knight on his last move. \par
Why do we know this, and how did he do it? Why do we know this, and how did he do it?
} }
@ -375,7 +375,7 @@ It is Black's move. Can he castle? \par
\begin{hintlist} \begin{hintlist}
Part 1: \tab\threestars{0}{4}{3} \par Part 1: \tab\threestars{0}{4}{3} \par
\hintcontentnew{ \hintcontent{
If White moved his king, Black cannot castle. Why? \par If White moved his king, Black cannot castle. Why? \par
That's the simple case. The other option: White castled. What did Black do before that? That's the simple case. The other option: White castled. What did Black do before that?
(Also, there was a promotion in this case.) (Also, there was a promotion in this case.)
@ -441,7 +441,7 @@ Which bishop was it, and what did it capture? \par
\begin{hintlist} \begin{hintlist}
Part 1: \tab\threestars{0}{1}{7} \par Part 1: \tab\threestars{0}{1}{7} \par
\hintcontentnew{ \hintcontent{
\begin{itemize} \begin{itemize}
\item How many pieces are missing? Where were the missing ones captured? \item How many pieces are missing? Where were the missing ones captured?
\item How did those pieces get to the place they were captured? \item How did those pieces get to the place they were captured?
@ -449,7 +449,7 @@ Which bishop was it, and what did it capture? \par
} }
Part 2: \tab\threestars{1}{2}{5} \par Part 2: \tab\threestars{1}{2}{5} \par
\hintcontentnew{ \hintcontent{
\begin{itemize} \begin{itemize}
\item The pawn on C3 came from D2, capturing a black rook. \item The pawn on C3 came from D2, capturing a black rook.
\item The black rook it captured couldn't have moved there before... \item The black rook it captured couldn't have moved there before...
@ -457,7 +457,7 @@ Which bishop was it, and what did it capture? \par
} }
Part 3: \tab\threestars{3}{2}{3} \par Part 3: \tab\threestars{3}{2}{3} \par
\hintcontentnew{ \hintcontent{
\begin{itemize} \begin{itemize}
\item ...the black pawn on G7 captured a white piece on H6. \item ...the black pawn on G7 captured a white piece on H6.
\item What else is missing? \item What else is missing?

View File

@ -3,7 +3,7 @@
% Sherlock, A matter of direction % Sherlock, A matter of direction
\problem{A matter of direction} \problem{A matter of direction}
%\difficulty{3}{5} %\difficulty{3}{5}
\starvalue{4} \onestars{4}
The results of a game of chess are shown below. \par The results of a game of chess are shown below. \par
Did White start on the north or south side of the board? \par Did White start on the north or south side of the board? \par
@ -18,7 +18,7 @@ Did White start on the north or south side of the board? \par
\begin{hintlist} \begin{hintlist}
Part 1: \tab\threestars{0}{1}{3} \par Part 1: \tab\threestars{0}{1}{3} \par
\hintcontentnew{ \hintcontent{
The bishop on H1 is important. How did White deliver this check? The bishop on H1 is important. How did White deliver this check?
} }
\vspace{2mm} \vspace{2mm}
@ -70,13 +70,13 @@ The white king has again become invisible. Find him. \par
\begin{hintlist} \begin{hintlist}
Part 1: \tab\threestars{0}{2}{6} \par Part 1: \tab\threestars{0}{2}{6} \par
\hintcontentnew{ \hintcontent{
Either the white king is on B3, or Black is in check. \par Either the white king is on B3, or Black is in check. \par
First, show that the latter implies the former. First, show that the latter implies the former.
} }
Part 2: \tab\threestars{2}{2}{4} \par Part 2: \tab\threestars{2}{2}{4} \par
\hintcontentnew{ \hintcontent{
Moving back in time, you'll need to add two pieces to the board (not counting the king). \par Moving back in time, you'll need to add two pieces to the board (not counting the king). \par
They have been captured! They have been captured!
} }
@ -165,7 +165,7 @@ White to move. Which side of the board did each color start on? \par
\begin{hintlist} \begin{hintlist}
Part 1: \tab\threestars{0}{5}{5} \par Part 1: \tab\threestars{0}{5}{5} \par
\hintcontentnew{ \hintcontent{
Double-checks make all positions seem impossible... \par Double-checks make all positions seem impossible... \par
Try E1 and F2 anyway. Can you add pieces to make it make sense? \par Try E1 and F2 anyway. Can you add pieces to make it make sense? \par
Don't forget about promotion. Don't forget about promotion.
@ -235,19 +235,19 @@ What is it, and what is its color? \par
\begin{hintlist} \begin{hintlist}
Part 1: \tab\threestars{0}{1}{19} \par Part 1: \tab\threestars{0}{1}{19} \par
\hintcontentnew{ \hintcontent{
What color is the missing piece? Count captures.\par What color is the missing piece? Count captures.\par
Look at the region bounded by A1 and B3. How did the bishop get there? Look at the region bounded by A1 and B3. How did the bishop get there?
} }
Part 2: \tab\threestars{1}{1}{18} \par Part 2: \tab\threestars{1}{1}{18} \par
\hintcontentnew{ \hintcontent{
What was White's last move? \par What was White's last move? \par
What does this tell us about White's king? What does this tell us about White's king?
} }
Part 3: \tab\threestars{2}{1}{17} \par Part 3: \tab\threestars{2}{1}{17} \par
\hintcontentnew{ \hintcontent{
Now, look at the region bounded by G1 and H3. \par Now, look at the region bounded by G1 and H3. \par
In Part 1, we found that all of White's pieces were captured---including the H1 rook. \par In Part 1, we found that all of White's pieces were captured---including the H1 rook. \par
How did it get off its home square to be captured? \par How did it get off its home square to be captured? \par
@ -255,14 +255,14 @@ What is it, and what is its color? \par
} }
Part 4: \tab\threestars{3}{2}{15} \par Part 4: \tab\threestars{3}{2}{15} \par
\hintcontentnew{ \hintcontent{
The black bishop on H2 must have been promoted on G1. \par The black bishop on H2 must have been promoted on G1. \par
Which pawn was it, and how did it get there? (Remember, we counted captures in Part 1). \par Which pawn was it, and how did it get there? (Remember, we counted captures in Part 1). \par
In what order did the cross capture by the G1 and H1 pawns occur? In what order did the cross capture by the G1 and H1 pawns occur?
} }
Part 5: \tab\threestars{5}{2}{13} \par Part 5: \tab\threestars{5}{2}{13} \par
\hintcontentnew{ \hintcontent{
Which black pieces are still missing? \par Which black pieces are still missing? \par
Remember that White cannot castle through check. Remember that White cannot castle through check.
} }

View File

@ -113,7 +113,7 @@ Show that he must be on C7.
% Arabian Knights 3 % Arabian Knights 3
\problem{The king in disguise once more} \problem{The king in disguise once more}
\difficultynote{2}{5}{(Assuming you've solved \ref{kingdisguise})} \difficulty{5}{7}
The white king is again exploring his kingdom, now under a different disguise. Where is he? \par The white king is again exploring his kingdom, now under a different disguise. Where is he? \par
\hint{\say{different disguise} implies that the white king looks like a different piece!} \hint{\say{different disguise} implies that the white king looks like a different piece!}

View File

@ -0,0 +1,33 @@
\def\nstars#1#2{%
\ifnum #2 > 0%
\def\starcolor{\color{#1}}%
\count255=1%
\loop{%
\starcolor $\bigstar$%
}%
\ifnum \count255 < #2%
\advance\count255 by 1%
\repeat%
\fi%
}
\def\startimes#1{
{\color{ogrape} $\bigstar \times #1$}
}
\def\onestars#1{
\nstars{ogrape}{#1}
}
\def\threestars#1#2#3{
\nstars{white}{#1}\nstars{ogrape}{#2}\nstars{white}{#3}
}
% Not used, commented out.
\def\difficulty#1#2{
\textbf{Difficulty:} \stars{#1}{#2} \par
\vspace{1mm}
}