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,E,C,C,C,C,C,C,C,C,C,C,E,H,H,H,H,H,H,H
C,C,C,C,C,C,C,C,C,E,I,B,B,B,B,B,I,E,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,E,B,B,B,B,B,B,E,C,C,C,C,C,C,C,C,C,C,E,H,H,H,H,H,H,H
\end{filecontents*}

\def\CouleursPALuffy{BleuCielIntense,Rouge,JauneNaples,Cannelle,Noir,Blanc,Jaune,VertTilleul,RougeFonce,Orange}
\setlength\parindent{0pt}
\NewDocumentCommand\TableauPixelArtLuffy{}{%
	\begin{tblr}[expand=\expanded]{width=6cm,colspec={Q[1.5cm,m,c]X[m,c]},hlines,vlines,rows={1.25cm},column{1}={font=\bfseries}}
		\expanded{\cctblr{BleuCielIntense}{Bleu clair}} & $7+3-5+2$ \\
		\expanded{\cctblr[Blanc]{Rouge}{Rouge}} & $4\times3-6\times2$ \\
		\expanded{\cctblr{JauneNaples}{Beige}} & $2\times\dfrac{2\times15-3}{5-2}$ \\
		\expanded{\cctblr[Blanc]{Cannelle}{Marron}} & $38-\dfrac{12-6}{3}$ \\
		\expanded{\cctblr[Blanc]{Noir}{Noir}} & $[(5+3)\times2-2]\div7$ \\
		\expanded{\cctblr{Blanc}{Blanc}} & $72\div6\div3$ \\
		\expanded{\cctblr{Jaune}{Jaune}} & $4+6\times3-12$ \\
		\expanded{\cctblr{VertTilleul}{Vert}} & $(6+2\times5)-(8\div4\times0)$ \\
		\expanded{\cctblr[Blanc]{RougeFonce}{Rouge foncé}} & $(7+3)-(5+2)$ \\
		\expanded{\cctblr{Orange}{Orange}} & $2+(15\times3-5)\div10$ \\
	\end{tblr}%
}
\NewDocumentCommand\EnoncePixelArtLuffy{}{%
	Effectue les différents calculs en détaillant les étapes sur ton cahier.\par
	Colorie chaque case de la bonne couleur.\par
	Une fois la grille terminée, découpe-la proprement et va la coller à son emplacement. Toutes les grilles réunies formeront probablement quelque chose\ldots\par
}

\NewDocumentCommand\GenerePagePixelArtLuffy{ m m }{%
	\pagebreak
	
	\EnoncePixelArtLuffy
	
	\vspace*{5mm}
	
	\begin{minipage}{7cm}
		\TableauPixelArtLuffy
	\end{minipage}
	\begin{minipage}{\dimexpr(\textwidth-7cm)\relax}
		\hfill\dtpixlarttikzblock[Unite=0.8,Style=\large\sffamily,Symb,Codes=ABCDEFGHIJ,Symboles={7,0,18,36,2,4,10,16,3,6}]{PALUFFY}{12x12}{#1}\hfill~
		
		\vspace*{1cm}
		
		\hfill\textcolor{BleuFonce}{\Huge\sffamily\bfseries #2}\hfill~
	\end{minipage}
}

\begin{document}

\pagestyle{empty}

\readdtcsv{PAgeantLuffy.csv}{PALUFFY}

\part*{PIXEL ART - COLLABORATIF (d'après Claire Housseux sur LeCoinBoulot)}

\hfill\dtpixlarttikz[Correction,Unite=0.3,Codes=ABCDEFGHIJ,Couleurs={\CouleursPALuffy},Decoupage=12x12]{PALUFFY}\hfill~

\vspace*{1cm}

\hfill\AideGrillePixelArtTikz{PAgeantLuffy.csv}{12x12}\hfill~

\GenerePagePixelArtLuffy{1/1}{A1}
\GenerePagePixelArtLuffy{1/2}{A2}
\GenerePagePixelArtLuffy{1/3}{A3}
\GenerePagePixelArtLuffy{1/4}{A4}
\GenerePagePixelArtLuffy{1/5}{A5}
\GenerePagePixelArtLuffy{2/1}{B1}
\GenerePagePixelArtLuffy{2/2}{B2}
\GenerePagePixelArtLuffy{2/3}{B3}
\GenerePagePixelArtLuffy{2/4}{B4}
\GenerePagePixelArtLuffy{2/5}{B5}
\GenerePagePixelArtLuffy{3/1}{C1}
\GenerePagePixelArtLuffy{3/2}{C2}
\GenerePagePixelArtLuffy{3/3}{C3}
\GenerePagePixelArtLuffy{3/4}{C4}
\GenerePagePixelArtLuffy{3/5}{C5}
\GenerePagePixelArtLuffy{4/1}{D1}
\GenerePagePixelArtLuffy{4/2}{D2}
\GenerePagePixelArtLuffy{4/3}{D3}
\GenerePagePixelArtLuffy{4/4}{D4}
\GenerePagePixelArtLuffy{4/5}{D5}
\GenerePagePixelArtLuffy{5/1}{E1}
\GenerePagePixelArtLuffy{5/2}{E2}
\GenerePagePixelArtLuffy{5/3}{E3}
\GenerePagePixelArtLuffy{5/4}{E4}
\GenerePagePixelArtLuffy{5/5}{E5}


\end{document}