Skip to content
Snippets Groups Projects
Commit 8c85e3cc authored by Jannik Dunkelau's avatar Jannik Dunkelau
Browse files

Fix some kerning in example algorithm

parent 9aa543cf
No related branches found
No related tags found
No related merge requests found
......@@ -170,32 +170,35 @@ Minimax-Algorithmus aufgeführt.
\begin{algorithmic}[1]
\Function{Minimax}{Game State Tree: $G^n$}
\State bestValue \(\gets -\infty\)
\State \(bestAction \gets \) NIL
\State \(\mathit{bestAction} \gets \) NIL
\ForAll{\(G^n_a \in S(G^n)\)}
\State \(value = \) \Call{MinimaxValue}{\(G^n_a\), true}
\If{\(value > bestValue\)} \Comment{Aktualisiere besten Wert}
\State \(bestValue \gets value\)
\State \(bestAction \gets a\)
\State \(\mathit{value} = \) \Call{MinimaxValue}{\(G^n_a\), true}
\If{\(\mathit{value} > \mathit{bestValue}\)}
\Comment{Aktualisiere besten Wert}
\State \(\mathit{bestValue} \gets \mathit{value}\)
\State \(\mathit{bestAction} \gets a\)
\EndIf
\EndFor
\State \Return \(bestAction\)
\State \Return \(\mathit{bestAction}\)
\EndFunction
\Statex
\Function{MinimaxValue}{Game State Tree: $G^n$ Boolean: $ourTurn$}
\Function{MinimaxValue}{Game State Tree: $G^n$, Boolean: $\mathit{ourTurn}$}
\If{\(D(G^n)=0\)}
\State \Return \Call{Heuristic}{root(\(G^n\))}
\ElsIf{\(ourTurn\)}
\State \(maxValue \gets -\infty \)
\ElsIf{\(\mathit{ourTurn}\)}
\State \(\mathit{maxValue} \gets -\infty \)
\ForAll{\(S \in S(G^n)\)}
\State \(newValue \gets \) \Call{MinimaxValue}{\(S\), false}
\State \(maxValue \gets max(newValue, maxValue)\)
\State \(\mathit{newValue} \gets \) \Call{MinimaxValue}{\(S\), false}
\State \(\mathit{maxValue} \gets
\max(\mathit{newValue}, \mathit{maxValue})\)
\EndFor
\State \Return \(maxValue\)
\Else
\State \(minValue \gets +\infty \)
\ForAll{\(S \in S(G^n)\)}
\State \(newValue \gets \) \Call{MinimaxValue}{\(S\), true}
\State \(minValue \gets \min(newValue, minValue)\)
\State \(\mathit{newValue} \gets \) \Call{MinimaxValue}{\(S\), true}
\State \(\mathit{minValue} \gets
\min(\mathit{newValue}, \mathit{minValue})\)
\EndFor
\State \Return \(minValue\)
\EndIf
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment