aboutsummaryrefslogtreecommitdiff
path: root/src/Lecture4/slides/6-PythonIntroduction.vrb
blob: 401cc07791faece3e8dbed154e3c089652a6a48f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
\frametitle{\texttt {while} loop}
\begin{columns}
    \column{0.45\textwidth}
      \texttt{{\bf while} \emph{condition}:}

      \texttt{\qquad instruction1}

      \texttt{\qquad instruction2}

      \texttt{\qquad \dots}
    \column{0.55\textwidth}
      \begin{tikzpicture}
        \tikzstyle{s} = [rectangle, rounded corners, text centered,
                                                       draw=black, fill=red!30]
        \tikzstyle{p} = [rectangle, text centered, draw=black, fill=orange!30]
        \tikzstyle{d} = [rectangle, text centered, draw=black, fill=green!30]

        \node(start)  [s]                     {Start};
        \node(cond)   [d, below of=start]     {\texttt{\emph{condition}}?};
        \node(inst1)  [p, right of=cond, xshift=2.7cm] {\texttt{instruction1}};
        \node(inst2)  [p, below of=inst1]     {\texttt{instruction2}};
        \node(dots)   [p, below of=inst2]     {\texttt{\dots}};
        \node(end)    [s, below of=other, yshift=-0.5cm] {End};

        \draw[->] (start) -- (cond);
        \draw[->] (cond) -- node[anchor=south] {\texttt{True}} (inst1);
        \draw[->] (inst1) -- (inst2);
        \draw[->] (inst2) -- (dots);
        \draw[->] (cond) -- node[anchor=east] {\texttt{False}} (end);
        \draw[->] (dots) -| ($(cond.south)+(0.4,0)$);
      \end{tikzpicture}
  \end{columns}

Generated with cgit - Back to sebastiano.tronto.net