1

I saw the following picture in Puerto Rico Mathematical Olympiad. The figure is a carpet unfolding.

enter image description here

I couldn't do the part of the cylinder, not introduce symbols on black squares

\documentclass{exam}
\usepackage{tikz}           
\usepackage{amsmath}   
\usepackage{amssymb}   
\usepackage{amsfonts}  
\usepackage{latexsym}       %simbolos do Latex    
\usepackage{bbm}        %simbolos de conjuntos   
\usepackage{pstricks}   
\usepackage{pstricks-add, pst-eucl, here}  
\usepackage{MnSymbol}

\begin{document}  
\begin{center}   
\begin{tikzpicture}[scale=0.8, angle=90]

\draw[ultra thick](0,0)--(7,0)--(7,9)--(0,9)--(0,0);    
\draw[thick] (1,0)--(1,9);    
\draw[thick] (2,0)--(2,9);    
\draw[thick] (3,0)--(3,9);   
\draw[thick] (4,0)--(4,9);   
\draw[thick] (5,0)--(5,9);
\draw[thick] (6,0)--(6,9);   
\draw[thick] (7,0)--(7,9);   
\draw[thick] (0,1)--(7,1); 
\draw[thick] (0,2)--(7,2);  
\draw[thick] (0,3)--(7,3);   
\draw[thick] (0,4)--(7,4);   
\draw[thick] (0,5)--(7,5);   
\draw[thick] (0,6)--(7,6);  
\draw[thick] (0,7)--(7,7);  
\draw[thick] (0,8)--(7,8);  
\draw[thick] (0,9)--(7,9);

\draw[thick,<-] (-0.5,0)--(-0.5,4);  
\draw[thick,->] (-0.5,4.5)--(-0.5,9);   
\draw[thick,<-] (0,-0.5)--(2.6,-0.5);  
\draw[thick,->] (3.7,-0.5)--(7,-0.5);

\draw[fill=black] (0,1) rectangle (1,2);  
\draw[fill=black] (2,1) rectangle (3,2);
\draw[fill=black] (4,1) rectangle (5,2);    
\draw[fill=black] (6,1) rectangle (7,2);
\draw[fill=black] (0,3) rectangle (1,4);   
\draw[fill=black] (2,3) rectangle (3,4);  
\draw[fill=black] (4,3) rectangle (5,4);   
\draw[fill=black] (6,3) rectangle (7,4);   
\draw[fill=black] (0,5) rectangle (1,6);    
\draw[fill=black] (2,5) rectangle (3,6);   
\draw[fill=black] (4,5) rectangle (5,6);    
\draw[fill=black] (6,5) rectangle (7,6);    
\draw[fill=black] (0,7) rectangle (1,8);    
\draw[fill=black] (2,7) rectangle (3,8);    
\draw[fill=black] (4,7) rectangle (5,8);    
\draw[fill=black] (6,7) rectangle (7,8);   
\draw[fill=black] (1,6) rectangle (2,7);    
\draw[fill=black] (3,6) rectangle (4,7);   
\draw[fill=black] (5,6) rectangle (6,7);   
\draw[fill=black] (3,0) rectangle (4,1);   
\draw[fill=black] (5,0) rectangle (6,1);   
\draw[fill=black] (1,0) rectangle (2,1);   
\draw[fill=black] (1,2) rectangle (2,3);   
\draw[fill=black] (3,2) rectangle (4,3);   
\draw[fill=black] (5,2) rectangle (6,3);   
\draw[fill=black] (1,4) rectangle (2,5);    
\draw[fill=black] (3,4) rectangle (4,5);   
\draw[fill=black] (5,4) rectangle (6,5);   
\draw[fill=black] (1,8) rectangle (2,9);   
\draw[fill=black] (3,8) rectangle (4,9);
\draw[fill=black] (5,8) rectangle (6,9);

\node at (0.5,0.5) {\LARGE{\textbf{$\ostar$}}};  
\node at (0.5,2.5) {\LARGE{\textbf{$\ostar$}}};   
\node at (0.5,4.5) {\LARGE{\textbf{$\ostar$}}};   
\node at (0.5,6.5) {\LARGE{\textbf{$\ostar$}}}; 
\node at (0.5,8.5) {\LARGE{\textbf{$\ostar$}}};    
\node at (1.5,1.5) {\LARGE{\textbf{$\ostar$}}};    
\node at (1.5,3.5) {\LARGE{\textbf{$\ostar$}}};   
\node at (1.5,5.5) {\LARGE{\textbf{$\ostar$}}};   
\node at (1.5,7.5) {\LARGE{\textbf{$\ostar$}}};    
\node at (2.5,0.5) {\LARGE{\textbf{$\ostar$}}};    
\node at (2.5,2.5) {\LARGE{\textbf{$\ostar$}}};   
\node at (2.5,4.5) {\LARGE{\textbf{$\ostar$}}};   
\node at (2.5,6.5) {\LARGE{\textbf{$\ostar$}}};   
\node at (2.5,8.5) {\LARGE{\textbf{$\ostar$}}};   
\node at (3.5,1.5) {\LARGE{\textbf{$\ostar$}}};   
\node at (3.5,3.5) {\LARGE{\textbf{$\ostar$}}};    
\node at (3.5,5.5) {\LARGE{\textbf{$\ostar$}}};   
\node at (3.5,7.5) {\LARGE{\textbf{$\ostar$}}};   
\node at (4.5,0.5) {\LARGE{\textbf{$\ostar$}}};   
\node at (4.5,2.5) {\LARGE{\textbf{$\ostar$}}};  
\node at (4.5,4.5) {\LARGE{\textbf{$\ostar$}}};  
\node at (4.5,6.5) {\LARGE{\textbf{$\ostar$}}};  
\node at (4.5,8.5) {\LARGE{\textbf{$\ostar$}}};  
\node at (5.5,1.5) {\LARGE{\textbf{$\ostar$}}};   
\node at (5.5,3.5) {\LARGE{\textbf{$\ostar$}}};  
\node at (5.5,5.5) {\LARGE{\textbf{$\ostar$}}};  
\node at (5.5,7.5) {\LARGE{\textbf{$\ostar$}}};  
\node at (6.5,0.5) {\LARGE{\textbf{$\ostar$}}};  
\node at (6.5,2.5) {\LARGE{\textbf{$\ostar$}}}; 
\node at (6.5,4.5) {\LARGE{\textbf{$\ostar$}}}; 
\node at (6.5,6.5) {\LARGE{\textbf{$\ostar$}}};  
\node at (6.5,8.5) {\LARGE{\textbf{$\ostar$}}};   
\node at (6.5,1.5) {\LARGE{\textbf{$\ostar$}}};   
\node at (6.5,3.5) {\LARGE{\textbf{$\ostar$}}};
\node at (6.5,5.5) {\LARGE{\textbf{$\ostar$}}};  
\node at (6.5,7.5) {\LARGE{\textbf{$\ostar$}}};  
\node at (1.5,8.5) {\LARGE{\textbf{$\leftmoon$}}};  
\node at (1.5,5.5) {\LARGE{\textbf{$\leftmoon$}}};  
\node at (3.5,0.5) {\LARGE{\textbf{$\leftmoon$}}}; 
\node at (3.5,2.5) {\LARGE{\textbf{$\leftmoon$}}}; 
\node at (3.5,6.5) {\LARGE{\textbf{$\leftmoon$}}}; 
\node at (5.5,4.5) {\LARGE{\textbf{$\leftmoon$}}};  
\node at (5.5,8.5) {\LARGE{\textbf{$\leftmoon$}}};   
\node at (-0.7, 4.25) {36dm};  
\node at (3.1, -0.5) {36dm}; 
\end{tikzpicture}  
\end{center}    
\end{document}

enter image description here

  • The text in black squares is black, so just add text=white to the node options. – Alenanno Feb 10 '16 at 16:02
  • Alenanno, I did. But, it doesn't work – benedito Feb 10 '16 at 16:41
3

You could also use a matrix to simplify the code.

\documentclass{exam}
\usepackage{tikz}           
\usepackage{amsmath}   
\usepackage{amsfonts}  
\usepackage{latexsym} 
\usepackage{mathabx} 
\usepackage{MnSymbol}

\usetikzlibrary{shapes.geometric}

\begin{document}  
\begin{center}   
\begin{tikzpicture}[scale=0.8]
  \def\B{\node[fill=black,text=white,minimum width=1cm,minimum height=1cm] {\LARGE$\leftmoon$};}%
  \def\W{\node[fill=white,minimum width=1cm,minimum height=1cm] {\LARGE$\ostar$};}%

\node[matrix,draw=black,ultra thick,inner sep=1pt] (grid)
{
  \W & \B & \W & \B & \W \\
  \B & \W & \B & \W & \B \\
  \W & \B & \W & \B & \W \\
  \B & \W & \B & \W & \B \\
  \W & \B & \W & \B & \W \\
  \B & \W & \B & \W & \B \\
  \W & \B & \W & \B & \W \\
  \B & \W & \B & \W & \B \\
  \W & \B & \W & \B & \W \\
};

\node[xshift=1cm,yshift=-.1cm,cylinder,rotate=90,
  draw=black,thick,fill=gray,
  minimum height=9.35cm,minimum width=2cm] at (grid.east) {};

\end{tikzpicture}  
\end{center}    
\end{document}

demo image

5

I have to admit that my "cylinder" doesn't look very realistic, but in any case, the result can be achieved with a much shorter code. If you do not understand something, feel free to ask, but I think that typing a lot of \node definitions gets tedious.

I left your package list as it was because I don't know if you use them somewhere else in your document, but many of these are not necessary for this code.

Output

enter image description here

Code

\documentclass[margin=10pt]{standalone}
\usepackage{tikz}           
\usepackage{amsmath}   
\usepackage{amssymb}   
\usepackage{amsfonts}  
\usepackage{latexsym}       %simbolos do Latex    
\usepackage{bbm}        %simbolos de conjuntos   
\usepackage{pstricks}   
\usepackage{pstricks-add, pst-eucl, here}  
\usepackage{MnSymbol}
\usepackage{wasysym}

\usetikzlibrary{arrows.meta, patterns, shadings}

\begin{document}  
\begin{tikzpicture}

\foreach \y [count=\nrow starting from 0] in {0,1,...,9} {
\foreach \x in {0,1,...,7} {
    \pgfmathsetmacro\color{int(mod(\y + \x, 2)) ? "black" : "white"}
    \fill[draw,fill=\color] (\x,\y) rectangle (\x+1,\y+1);
    \ifnum\pdfstrcmp{\color}{white}=0
        \node[font=\bfseries\LARGE] at (\x+.5,\y+.5) {$\ostar$}; 
    \else
        \node[font=\bfseries\LARGE, text=white] at (\x+.5,\y+.5) {$\leftmoon$};
    \fi 
    }
}

\draw[left color=gray!50!black, right color=gray!50!black, middle color=gray!80, pattern color=black] (7.3,.3) --++ (0,9.7) arc (180:0:.7 and .3) -- (8.7,.3) -- cycle;
\fill[gray!30!black] (8,.25) ellipse (.7 and .3);

\draw[{Latex}-{Latex}] (0,-1) -- (8,-1)  node[fill=white, midway] {60dm};
\draw[{Latex}-{Latex}] (-1,0) -- (-1,10) node[fill=white, midway] {36dm};
\end{tikzpicture}    
\end{document}
  • Alenanno, Your solution was very good. But, please, there are 5 types of symbols on the Board, see figure. I'm still with doubts about the placement of symbols in their black squares – benedito Feb 10 '16 at 19:35
  • @benedito As in, rotated moons? – Alenanno Feb 10 '16 at 20:38
  • Alenanno, Sorry, I don't understand. My problem is to place each symbol in the respective black house. – benedito Feb 11 '16 at 0:02
  • @benedito you said there are more symbols, so I was wondering which ones they are. – Alenanno Feb 11 '16 at 0:03
  • Alenanno, Thanks. The symbols to which I refer are the black houses: multiple rotations of the Moon – benedito Feb 11 '16 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.