【006_ヨセフスの問題】コマ大数学科
勉強用です。
重ねて描くときにforeachを使っています。
白で塗りつぶしてもいます。
\begin{tikzpicture}
\\
\foreach \x in {0,0.1,...,1}
{
\filldraw [rounded corners=5pt,fill=white] ({\x},{\x})rectangle ({(\x)+(1.5)},{(\x)+(2)});
}
\node at (2,2.3)[font=\LARGE,below left]{1};
\node at (0,3)[below right]{$\maruichi$};
\draw [->,thick](2,1.5) to [out=270,in=270](0,0)node at (1,-0.4)[below]{後ろに回す};
\end{tikzpicture}
\hspace{1cm}
% 2回め
\begin{tikzpicture}
% ==階段,放物線,
% 線を引く
\\
\foreach \x in {0,0.1,...,1}
{
\filldraw [rounded corners=5pt,fill=white] ({\x},{\x})rectangle ({(\x)+(1.5)},{(\x)+(2)});
}
\node at (2,2.3)[font=\LARGE,below left]{2};
\node at (0,3)[below right]{$\maruni$};
\draw [->,thick](2,1.5) to [out=270,in=180](2.5,-0.7)node at (2,-0.7)[left]{捨てる};
\end{tikzpicture}
\hspace{1cm}
% 3回目
\begin{tikzpicture}
\\
\foreach \x in {0,0.1,...,1}
{
\filldraw [rounded corners=5pt,fill=white] ({\x},{\x})rectangle ({(\x)+(1.5)},{(\x)+(2)});
}
\node at (2,2.3)[font=\LARGE,below left]{3};
\node at (0,3)[below right]{$\marusan$};
\draw [->,thick](2,1.5) to [out=270,in=270](0,0)node at (1,-0.4)[below]{後ろに回す};
\end{tikzpicture}
\hspace{1cm}
% 4回め
\begin{tikzpicture}
\\
\foreach \x in {0,0.1,...,1}
{
\filldraw [rounded corners=5pt,fill=white] ({\x},{\x})rectangle ({(\x)+(1.5)},{(\x)+(2)});
}
\node at (2,2.3)[font=\LARGE,below left]{4};
\node at (0,3)[below right]{$\marushi$};
\draw [->,thick](2,1.5) to [out=270,in=180](2.5,-0.7)node at (2,-0.7)[left]{捨てる};
\end{tikzpicture}