LoginSignup
0
0

More than 3 years have passed since last update.

【006_ヨセフスの問題】コマ大数学科

Last updated at Posted at 2021-01-13

【006_ヨセフスの問題】コマ大数学科

勉強用です。
重ねて描くときにforeachを使っています。
白で塗りつぶしてもいます。

image.png


\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}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0