aboutsummaryrefslogtreecommitdiff
path: root/Info/11/NTG/1/Breitensuche/pseudocode.tex
blob: c49adae443a49607c88ff4d2322d0d9efb47a7a9 (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
33
34
35
36
37
38
39
40
41
42
\documentclass[vardwidth]{standalone}
\usepackage[most]{tcolorbox}
\usetikzlibrary{decorations.pathmorphing} % For my tcolorboxes
\newtcolorbox{pseudocode}{
  coltitle=white,
  colbacktitle=gray!30!black,
  colframe=gray!30!black,
  enhanced,
  title=\bfseries {\large P}SEUDOCODE,
  attach boxed title to top right={yshift=-0.28cm, xshift=-5mm},
  frame code={
    \draw[
      decorate,
      decoration={random steps, segment length=5mm, amplitude=0.6pt},
      draw=gray!30!black
    ] (frame.north east) rectangle (frame.south west);
  },
}
\newcommand\textvtt[1]{{\normalfont\fontfamily{cmvtt}\selectfont #1}}
\newcommand{\codeIndent}{0.5cm}

\begin{document}
\begin{pseudocode}
\texttt{Markiere den Startknoten.}
\vspace{0.1cm}

\textvtt{Füge den Startknoten der Warteschlange hinzu.}
\vspace{0.1cm}

\textvtt{Solange die Warteschlange nicht leer ist ...}
\vspace{0.1cm}

\hspace{\codeIndent{}}\textvtt{Nimm den ersten Knoten aus der Warteschlange.}
\vspace{0.1cm}

\hspace{\codeIndent{}}\textvtt{Füge alle unmarkierten Nachbarn in die Wartschlange ein.}
\vspace{0.1cm}

\hspace{\codeIndent{}}\textvtt{Markiere alle unmarkierte Nachbarn.}
\end{pseudocode}
\end{document}