From e4ebdac31a6d67d3e13b0fd123ef9cdba8916895 Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 6 Dec 2023 14:03:22 -0800 Subject: [PATCH] Minor cleanup --- Advanced/Retrograde Analysis/chess-setup.tex | 37 ++++++++ Advanced/Retrograde Analysis/main.tex | 94 ++----------------- .../Retrograde Analysis/parts/00 rules.tex | 6 +- .../Retrograde Analysis/parts/02 easy.tex | 40 ++++---- .../Retrograde Analysis/parts/03 medium.tex | 20 ++-- .../Retrograde Analysis/parts/04 hard.tex | 2 +- Advanced/Retrograde Analysis/stars.tex | 33 +++++++ 7 files changed, 112 insertions(+), 120 deletions(-) create mode 100644 Advanced/Retrograde Analysis/chess-setup.tex create mode 100644 Advanced/Retrograde Analysis/stars.tex diff --git a/Advanced/Retrograde Analysis/chess-setup.tex b/Advanced/Retrograde Analysis/chess-setup.tex new file mode 100644 index 0000000..ed8e59b --- /dev/null +++ b/Advanced/Retrograde Analysis/chess-setup.tex @@ -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 \ No newline at end of file diff --git a/Advanced/Retrograde Analysis/main.tex b/Advanced/Retrograde Analysis/main.tex index 84cba44..66eb9c6 100755 --- a/Advanced/Retrograde Analysis/main.tex +++ b/Advanced/Retrograde Analysis/main.tex @@ -13,79 +13,15 @@ \usepackage{afterpage} \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} +\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 -\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} {Score Decomposition:} @@ -100,34 +36,20 @@ $\odot$}} \end{@hintlist} } - -\def\threestars#1#2#3{ - \nstars{white}{#1}\nstars{ogrape}{#2}\nstars{white}{#3} -} - -\def\onestars#1{ - \nstars{ogrape}{#1} -} - -\long\def\hintcontentnew#1{ +\long\def\hintcontent#1{ \if@solutions #1 \par \vspace{2mm} \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 + + + \uptitlel{Advanced 2} \uptitler{Fall 2023} \title{Retrograde Analysis} diff --git a/Advanced/Retrograde Analysis/parts/00 rules.tex b/Advanced/Retrograde Analysis/parts/00 rules.tex index 42e50c3..3f5d844 100644 --- a/Advanced/Retrograde Analysis/parts/00 rules.tex +++ b/Advanced/Retrograde Analysis/parts/00 rules.tex @@ -7,7 +7,7 @@ An example is below. \vspace{4mm} \generic{Problem $0$:} -\starvalue{4} +\onestars{4} This is a problem that has two parts. \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} Part 1: \tab\threestars{0}{1}{3} \par - \hintcontentnew{ + \hintcontent{ This is a hint. Only instructors see this. } Part 2: \tab\threestars{1}{2}{1} \par - \hintcontentnew{ + \hintcontent{ This is another hint. } diff --git a/Advanced/Retrograde Analysis/parts/02 easy.tex b/Advanced/Retrograde Analysis/parts/02 easy.tex index 6031da7..1db28bb 100644 --- a/Advanced/Retrograde Analysis/parts/02 easy.tex +++ b/Advanced/Retrograde Analysis/parts/02 easy.tex @@ -5,7 +5,7 @@ % Sherlock, A little exercise \problem{A little exercise} %\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 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} Part 1: \tab\threestars{0}{1}{2} \par - \hintcontentnew{ + \hintcontent{ What was Black's last move? What White do to make this happen? } Part 2: \tab\threestars{1}{1}{1} \par - \hintcontentnew{ + \hintcontent{ 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? \problem{Which color?} %\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. There is a pawn at G3. What color is it? \par 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} Part 1: \tab\threestars{0}{1}{3} \par - \hintcontentnew{ + \hintcontent{ How did the white king get off E1? It must have castled! } Part 2: \tab\threestars{1}{1}{2} \par - \hintcontentnew{ + \hintcontent{ 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 \problem{Invisible, but not invincible} %\difficulty{2}{5} -\starvalue{4} +\onestars{4} The black king has turned himself invisible. Unfortunately, his position is hopeless. \par Mate the king in one move. \par @@ -137,7 +137,7 @@ Mate the king in one move. \par \begin{hintlist} Part 1: \tab\threestars{0}{1}{3} \par - \hintcontentnew{Don't forget about promotion.} + \hintcontent{Don't forget about promotion.} \vspace{2mm} Done: \tab\threestars{1}{3}{0} @@ -166,7 +166,7 @@ Mate the king in one move. \par % Sherlock, a question of survival \problem{An empty board} %\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. 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} 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} 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 \problem{The knight's grave} %\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. The white king has made less than fourteen moves. \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} 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. } \vspace{2mm} @@ -249,7 +249,7 @@ Use this information to show that a pawn was promoted. \par % Arabian Knights, intro (given with solution) \problem{Promotion?} %\difficulty{2}{5} -\starvalue{6} +\onestars{6} 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} Part 1: \tab\threestars{0}{4}{2} \par - \hintcontentnew{ + \hintcontent{ 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. } @@ -296,7 +296,7 @@ It is White's move. Have there been any promotions this game? \par % Sherlock Holmes, two bagatelles (1) \problem{Whodunit} %\difficulty{2}{5} -\starvalue{6} +\onestars{6} 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.} @@ -312,7 +312,7 @@ It is Black's move. Can Black castle? \par \begin{hintlist} Part 1: \tab\threestars{0}{4}{2} \par - \hintcontentnew{ + \hintcontent{ Black captured a knight on his last move. \par 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} Part 1: \tab\threestars{0}{4}{3} \par - \hintcontentnew{ + \hintcontent{ 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? (Also, there was a promotion in this case.) @@ -441,7 +441,7 @@ Which bishop was it, and what did it capture? \par \begin{hintlist} Part 1: \tab\threestars{0}{1}{7} \par - \hintcontentnew{ + \hintcontent{ \begin{itemize} \item How many pieces are missing? Where were the missing ones 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 - \hintcontentnew{ + \hintcontent{ \begin{itemize} \item The pawn on C3 came from D2, capturing a black rook. \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 - \hintcontentnew{ + \hintcontent{ \begin{itemize} \item ...the black pawn on G7 captured a white piece on H6. \item What else is missing? diff --git a/Advanced/Retrograde Analysis/parts/03 medium.tex b/Advanced/Retrograde Analysis/parts/03 medium.tex index 202a462..d51742f 100644 --- a/Advanced/Retrograde Analysis/parts/03 medium.tex +++ b/Advanced/Retrograde Analysis/parts/03 medium.tex @@ -3,7 +3,7 @@ % Sherlock, A matter of direction \problem{A matter of direction} %\difficulty{3}{5} -\starvalue{4} +\onestars{4} The results of a game of chess are shown below. \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} Part 1: \tab\threestars{0}{1}{3} \par - \hintcontentnew{ + \hintcontent{ The bishop on H1 is important. How did White deliver this check? } \vspace{2mm} @@ -70,13 +70,13 @@ The white king has again become invisible. Find him. \par \begin{hintlist} Part 1: \tab\threestars{0}{2}{6} \par - \hintcontentnew{ + \hintcontent{ Either the white king is on B3, or Black is in check. \par First, show that the latter implies the former. } 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 They have been captured! } @@ -165,7 +165,7 @@ White to move. Which side of the board did each color start on? \par \begin{hintlist} Part 1: \tab\threestars{0}{5}{5} \par - \hintcontentnew{ + \hintcontent{ Double-checks make all positions seem impossible... \par Try E1 and F2 anyway. Can you add pieces to make it make sense? \par Don't forget about promotion. @@ -235,19 +235,19 @@ What is it, and what is its color? \par \begin{hintlist} Part 1: \tab\threestars{0}{1}{19} \par - \hintcontentnew{ + \hintcontent{ What color is the missing piece? Count captures.\par Look at the region bounded by A1 and B3. How did the bishop get there? } Part 2: \tab\threestars{1}{1}{18} \par - \hintcontentnew{ + \hintcontent{ What was White's last move? \par What does this tell us about White's king? } Part 3: \tab\threestars{2}{1}{17} \par - \hintcontentnew{ + \hintcontent{ 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 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 - \hintcontentnew{ + \hintcontent{ 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 In what order did the cross capture by the G1 and H1 pawns occur? } Part 5: \tab\threestars{5}{2}{13} \par - \hintcontentnew{ + \hintcontent{ Which black pieces are still missing? \par Remember that White cannot castle through check. } diff --git a/Advanced/Retrograde Analysis/parts/04 hard.tex b/Advanced/Retrograde Analysis/parts/04 hard.tex index 5576b3a..8f84d96 100644 --- a/Advanced/Retrograde Analysis/parts/04 hard.tex +++ b/Advanced/Retrograde Analysis/parts/04 hard.tex @@ -113,7 +113,7 @@ Show that he must be on C7. % Arabian Knights 3 \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 \hint{\say{different disguise} implies that the white king looks like a different piece!} diff --git a/Advanced/Retrograde Analysis/stars.tex b/Advanced/Retrograde Analysis/stars.tex new file mode 100644 index 0000000..602765d --- /dev/null +++ b/Advanced/Retrograde Analysis/stars.tex @@ -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} +} +