% !TEX Fiche « Le fou » — source générée par le_fou_generateur.php
% Design « fiches » commun au site (cf. coll/latex_fiche_commun.py).
\documentclass[a4paper,11pt]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[french]{babel}
\usepackage[a4paper,top=3.2cm,bottom=2cm,left=2cm,right=2cm]{geometry}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{fancyhdr}
\usepackage{qrcode}
\usepackage[table]{xcolor}
\usepackage{amsmath,amssymb}
\usepackage{enumitem}
\AtBeginDocument{%
  \setlist[itemize]{leftmargin=1.8em,itemsep=0.5ex,topsep=0.4ex,parsep=0pt}%
  \setlist[itemize,1]{label=\textcolor{red!75!black}{\small\textbullet}}%
  \setlist[itemize,2]{label=\textcolor{red!75!black}{\scriptsize\textbullet}}%
}
\usepackage{titlesec}
\titlespacing*{\section}{0pt}{1.4ex}{0.6ex}
\titlespacing*{\subsection}{0pt}{1.0ex}{0.3ex}
\usepackage{multicol}
\setlength{\columnsep}{1.5em}
\usepackage{needspace}
\usepackage{tikz}
\usetikzlibrary{decorations.text}

\usepackage{tgheros}
\usepackage{xskak,chessboard}
\setchessboard{showmover=false,boardfontsize=12pt}
\pagestyle{fancy}
\fancyhf{}
\setlength{\headheight}{75pt}
\setlength{\headsep}{10pt}

\newcommand{\logowouf}{%
\begin{tikzpicture}[baseline={(current bounding box.center)},scale=0.55,
                    line cap=round,line join=round]
    \path[use as bounding box] (-2.20,-1.45) rectangle (2.20,2.20);
    \path[
        postaction={decorate},
        decoration={
            text along path,
            text={|\fontfamily{qhv}\bfseries\fontsize{9}{9}\selectfont|site2wouf.fr},
            text align={center},
            raise=0.03ex
        }
    ] (-1.29,0.48) arc[start angle=160,end angle=20,radius=1.29];
    \begin{scope}[xshift=-0.06cm]
        \fill[black] (-0.66,0.14) ellipse (0.21 and 0.31);
        \fill[black] ( 0.66,0.14) ellipse (0.21 and 0.31);
        \fill[black] (-0.23,0.49) ellipse (0.22 and 0.35);
        \fill[black] ( 0.23,0.49) ellipse (0.22 and 0.35);
        \fill[black]
            (0,-0.10)
            .. controls (-0.36,-0.02) and (-0.63,-0.24) .. (-0.58,-0.58)
            .. controls (-0.52,-0.93) and (-0.16,-1.12) .. (0,-0.90)
            .. controls (0.16,-1.12) and (0.52,-0.93) .. (0.58,-0.58)
            .. controls (0.63,-0.24) and (0.36,-0.02) .. (0,-0.10)
            -- cycle;
    \end{scope}
\end{tikzpicture}%
}
\newcommand{\titre}{Le fou et ses libert\'es}
\newcommand{\soustitre}{Cycle 3 et Cycle 4 · Fiche personnalisée}

\fancyhead[C]{%
\raisebox{4pt}{%
\begin{minipage}[c]{0.15\textwidth}
    \centering
    \logowouf
\end{minipage}
\begin{minipage}[c]{0.62\textwidth}
    \centering
    {\Large\bfseries \titre\par}
    {\small\color{gray} \soustitre}
\end{minipage}
\begin{minipage}[c]{0.21\textwidth}
    \centering
    \qrcode[height=1.5cm]{https://site2wouf.fr/le_fou.php?t=h1.c1-e7}\\[2pt]
    {\small\ttfamily\bfseries\color{red} h1.c1-e7}
\end{minipage}%
}
}

\begin{document}
\newchessgame

\noindent Aux \'echecs, le \textbf{fou} se d\'eplace en \textbf{diagonale} et reste toujours sur des cases de la \textbf{m\^eme couleur}. Par exemple, depuis la case \textbf{d4}, il peut aller sur les cases surlign\'ees : \texttt{a1, a7, b2, b6, c3, c5, e3, e5, f2, f6, g1, g7, h8}.
\begin{center}
  \chessboard[clearboard,showmover=false,pgfstyle=color,color=green!45,markfields={a1,a7,b2,b6,c3,c5,e3,e5,f2,f6,g1,g7,h8},setpieces={Bd4}]
\end{center}
\begin{enumerate}[label=\textbf{\arabic*.},leftmargin=*,itemsep=1.4ex]
  \item \textbf{Un fou en h1.} On pose un fou en \textbf{h1}. Sur quelles cases peut-il aller ? Combien a-t-il de libert\'es ?
  \item \textbf{Une enqu\^ete.} Un fou peut se rendre en \textbf{c1} et \textbf{e7}. Sur quelle(s) case(s) est-il situ\'e ?
  \item \textbf{Les libert\'es selon la case.} \'Etudie, \`a l'aide d'un diagramme colori\'e et l\'egend\'e, le nombre de libert\'es du fou \emph{en fonction de sa case de d\'epart}. Que remarques-tu ?
\end{enumerate}
\newpage
\section*{Corrig\'e}
\noindent\textbf{1.} Le fou en h1 a \textbf{7 libert\'es} : \texttt{a8, b7, c6, d5, e4, f3, g2}.
\begin{center}
  \chessboard[clearboard,showmover=false,pgfstyle=color,color=green!45,markfields={a8,b7,c6,d5,e4,f3,g2},setpieces={Bh1}]
\end{center}
\smallskip\noindent\textbf{2.} Un fou qui peut se rendre en \textbf{c1} et \textbf{e7} se trouve sur \textbf{a3} ou \textbf{g5}. Les fl\`eches montrent, depuis chaque fou, ses d\'eplacements en diagonale vers les deux cases-indices.
\begin{center}
  \chessboard[clearboard,showmover=false,pgfstyle=color,color=yellow!70,markfields={c1},color=blue!35,markfields={e7},setpieces={Ba3, Bg5},pgfstyle=straightmove,arrow=to,linewidth=0.15em,color=green!55!black,markmoves={a3-c1,a3-e7,g5-c1,g5-e7}]
\end{center}
\nopagebreak\begin{center}\footnotesize
\colorbox{yellow!70}{~~}~case-indice c1 \quad \colorbox{blue!35}{~~}~case-indice e7 \quad \textcolor{green!55!black}{\textbf{\textrightarrow}}~trajets des fous vers les indices
\end{center}
\smallskip\noindent\textbf{3.}
\begin{center}
\begin{tikzpicture}[scale=0.60,line join=round]
  \fill[red!0!yellow] (0,0) rectangle +(1,1);
  \node[font=\tiny,text=black] at (0.5,0.5) {7};
  \fill[red!0!yellow] (1,0) rectangle +(1,1);
  \node[font=\tiny,text=black] at (1.5,0.5) {7};
  \fill[red!0!yellow] (2,0) rectangle +(1,1);
  \node[font=\tiny,text=black] at (2.5,0.5) {7};
  \fill[red!0!yellow] (3,0) rectangle +(1,1);
  \node[font=\tiny,text=black] at (3.5,0.5) {7};
  \fill[red!0!yellow] (4,0) rectangle +(1,1);
  \node[font=\tiny,text=black] at (4.5,0.5) {7};
  \fill[red!0!yellow] (5,0) rectangle +(1,1);
  \node[font=\tiny,text=black] at (5.5,0.5) {7};
  \fill[red!0!yellow] (6,0) rectangle +(1,1);
  \node[font=\tiny,text=black] at (6.5,0.5) {7};
  \fill[red!0!yellow] (7,0) rectangle +(1,1);
  \node[font=\tiny,text=black] at (7.5,0.5) {7};
  \fill[red!0!yellow] (0,1) rectangle +(1,1);
  \node[font=\tiny,text=black] at (0.5,1.5) {7};
  \fill[red!33!yellow] (1,1) rectangle +(1,1);
  \node[font=\tiny,text=black] at (1.5,1.5) {9};
  \fill[red!33!yellow] (2,1) rectangle +(1,1);
  \node[font=\tiny,text=black] at (2.5,1.5) {9};
  \fill[red!33!yellow] (3,1) rectangle +(1,1);
  \node[font=\tiny,text=black] at (3.5,1.5) {9};
  \fill[red!33!yellow] (4,1) rectangle +(1,1);
  \node[font=\tiny,text=black] at (4.5,1.5) {9};
  \fill[red!33!yellow] (5,1) rectangle +(1,1);
  \node[font=\tiny,text=black] at (5.5,1.5) {9};
  \fill[red!33!yellow] (6,1) rectangle +(1,1);
  \node[font=\tiny,text=black] at (6.5,1.5) {9};
  \fill[red!0!yellow] (7,1) rectangle +(1,1);
  \node[font=\tiny,text=black] at (7.5,1.5) {7};
  \fill[red!0!yellow] (0,2) rectangle +(1,1);
  \node[font=\tiny,text=black] at (0.5,2.5) {7};
  \fill[red!33!yellow] (1,2) rectangle +(1,1);
  \node[font=\tiny,text=black] at (1.5,2.5) {9};
  \fill[red!67!yellow] (2,2) rectangle +(1,1);
  \node[font=\tiny,text=white] at (2.5,2.5) {11};
  \fill[red!67!yellow] (3,2) rectangle +(1,1);
  \node[font=\tiny,text=white] at (3.5,2.5) {11};
  \fill[red!67!yellow] (4,2) rectangle +(1,1);
  \node[font=\tiny,text=white] at (4.5,2.5) {11};
  \fill[red!67!yellow] (5,2) rectangle +(1,1);
  \node[font=\tiny,text=white] at (5.5,2.5) {11};
  \fill[red!33!yellow] (6,2) rectangle +(1,1);
  \node[font=\tiny,text=black] at (6.5,2.5) {9};
  \fill[red!0!yellow] (7,2) rectangle +(1,1);
  \node[font=\tiny,text=black] at (7.5,2.5) {7};
  \fill[red!0!yellow] (0,3) rectangle +(1,1);
  \node[font=\tiny,text=black] at (0.5,3.5) {7};
  \fill[red!33!yellow] (1,3) rectangle +(1,1);
  \node[font=\tiny,text=black] at (1.5,3.5) {9};
  \fill[red!67!yellow] (2,3) rectangle +(1,1);
  \node[font=\tiny,text=white] at (2.5,3.5) {11};
  \fill[red!100!yellow] (3,3) rectangle +(1,1);
  \node[font=\tiny,text=white] at (3.5,3.5) {13};
  \fill[red!100!yellow] (4,3) rectangle +(1,1);
  \node[font=\tiny,text=white] at (4.5,3.5) {13};
  \fill[red!67!yellow] (5,3) rectangle +(1,1);
  \node[font=\tiny,text=white] at (5.5,3.5) {11};
  \fill[red!33!yellow] (6,3) rectangle +(1,1);
  \node[font=\tiny,text=black] at (6.5,3.5) {9};
  \fill[red!0!yellow] (7,3) rectangle +(1,1);
  \node[font=\tiny,text=black] at (7.5,3.5) {7};
  \fill[red!0!yellow] (0,4) rectangle +(1,1);
  \node[font=\tiny,text=black] at (0.5,4.5) {7};
  \fill[red!33!yellow] (1,4) rectangle +(1,1);
  \node[font=\tiny,text=black] at (1.5,4.5) {9};
  \fill[red!67!yellow] (2,4) rectangle +(1,1);
  \node[font=\tiny,text=white] at (2.5,4.5) {11};
  \fill[red!100!yellow] (3,4) rectangle +(1,1);
  \node[font=\tiny,text=white] at (3.5,4.5) {13};
  \fill[red!100!yellow] (4,4) rectangle +(1,1);
  \node[font=\tiny,text=white] at (4.5,4.5) {13};
  \fill[red!67!yellow] (5,4) rectangle +(1,1);
  \node[font=\tiny,text=white] at (5.5,4.5) {11};
  \fill[red!33!yellow] (6,4) rectangle +(1,1);
  \node[font=\tiny,text=black] at (6.5,4.5) {9};
  \fill[red!0!yellow] (7,4) rectangle +(1,1);
  \node[font=\tiny,text=black] at (7.5,4.5) {7};
  \fill[red!0!yellow] (0,5) rectangle +(1,1);
  \node[font=\tiny,text=black] at (0.5,5.5) {7};
  \fill[red!33!yellow] (1,5) rectangle +(1,1);
  \node[font=\tiny,text=black] at (1.5,5.5) {9};
  \fill[red!67!yellow] (2,5) rectangle +(1,1);
  \node[font=\tiny,text=white] at (2.5,5.5) {11};
  \fill[red!67!yellow] (3,5) rectangle +(1,1);
  \node[font=\tiny,text=white] at (3.5,5.5) {11};
  \fill[red!67!yellow] (4,5) rectangle +(1,1);
  \node[font=\tiny,text=white] at (4.5,5.5) {11};
  \fill[red!67!yellow] (5,5) rectangle +(1,1);
  \node[font=\tiny,text=white] at (5.5,5.5) {11};
  \fill[red!33!yellow] (6,5) rectangle +(1,1);
  \node[font=\tiny,text=black] at (6.5,5.5) {9};
  \fill[red!0!yellow] (7,5) rectangle +(1,1);
  \node[font=\tiny,text=black] at (7.5,5.5) {7};
  \fill[red!0!yellow] (0,6) rectangle +(1,1);
  \node[font=\tiny,text=black] at (0.5,6.5) {7};
  \fill[red!33!yellow] (1,6) rectangle +(1,1);
  \node[font=\tiny,text=black] at (1.5,6.5) {9};
  \fill[red!33!yellow] (2,6) rectangle +(1,1);
  \node[font=\tiny,text=black] at (2.5,6.5) {9};
  \fill[red!33!yellow] (3,6) rectangle +(1,1);
  \node[font=\tiny,text=black] at (3.5,6.5) {9};
  \fill[red!33!yellow] (4,6) rectangle +(1,1);
  \node[font=\tiny,text=black] at (4.5,6.5) {9};
  \fill[red!33!yellow] (5,6) rectangle +(1,1);
  \node[font=\tiny,text=black] at (5.5,6.5) {9};
  \fill[red!33!yellow] (6,6) rectangle +(1,1);
  \node[font=\tiny,text=black] at (6.5,6.5) {9};
  \fill[red!0!yellow] (7,6) rectangle +(1,1);
  \node[font=\tiny,text=black] at (7.5,6.5) {7};
  \fill[red!0!yellow] (0,7) rectangle +(1,1);
  \node[font=\tiny,text=black] at (0.5,7.5) {7};
  \fill[red!0!yellow] (1,7) rectangle +(1,1);
  \node[font=\tiny,text=black] at (1.5,7.5) {7};
  \fill[red!0!yellow] (2,7) rectangle +(1,1);
  \node[font=\tiny,text=black] at (2.5,7.5) {7};
  \fill[red!0!yellow] (3,7) rectangle +(1,1);
  \node[font=\tiny,text=black] at (3.5,7.5) {7};
  \fill[red!0!yellow] (4,7) rectangle +(1,1);
  \node[font=\tiny,text=black] at (4.5,7.5) {7};
  \fill[red!0!yellow] (5,7) rectangle +(1,1);
  \node[font=\tiny,text=black] at (5.5,7.5) {7};
  \fill[red!0!yellow] (6,7) rectangle +(1,1);
  \node[font=\tiny,text=black] at (6.5,7.5) {7};
  \fill[red!0!yellow] (7,7) rectangle +(1,1);
  \node[font=\tiny,text=black] at (7.5,7.5) {7};
  \draw[gray!55,line width=0.3pt] (0,0) grid (8,8);
  \draw[black,line width=0.7pt] (0,0) rectangle (8,8);
  \node[font=\tiny] at (0.5,-0.32) {a};
  \node[font=\tiny] at (1.5,-0.32) {b};
  \node[font=\tiny] at (2.5,-0.32) {c};
  \node[font=\tiny] at (3.5,-0.32) {d};
  \node[font=\tiny] at (4.5,-0.32) {e};
  \node[font=\tiny] at (5.5,-0.32) {f};
  \node[font=\tiny] at (6.5,-0.32) {g};
  \node[font=\tiny] at (7.5,-0.32) {h};
  \node[font=\tiny] at (-0.32,0.5) {1};
  \node[font=\tiny] at (-0.32,1.5) {2};
  \node[font=\tiny] at (-0.32,2.5) {3};
  \node[font=\tiny] at (-0.32,3.5) {4};
  \node[font=\tiny] at (-0.32,4.5) {5};
  \node[font=\tiny] at (-0.32,5.5) {6};
  \node[font=\tiny] at (-0.32,6.5) {7};
  \node[font=\tiny] at (-0.32,7.5) {8};
\end{tikzpicture}
\end{center}
\nopagebreak\begin{center}\footnotesize
\colorbox{red!0!yellow}{~~}~7 \quad \colorbox{red!33!yellow}{~~}~9 \quad \colorbox{red!67!yellow}{~~}~11 \quad \colorbox{red!100!yellow}{~~}~13 \quad libert\'es
\end{center}
\noindent Contrairement \`a la tour, les libert\'es du fou \textbf{d\'ependent de sa position} et se r\'epartissent en \textbf{anneaux concentriques} : \textbf{13} au centre, puis 11, 9, et seulement \textbf{7} sur les bords. Plus le fou est central, plus il est libre.
\end{document}
