Исправил отступы в коде прощающей стратегии
This commit is contained in:
@@ -369,13 +369,13 @@
|
|||||||
\begin{lstlisting}[caption={Код функции, реализующей прощающую стратегию.}, label={lst:forgivingStrategy}]
|
\begin{lstlisting}[caption={Код функции, реализующей прощающую стратегию.}, label={lst:forgivingStrategy}]
|
||||||
forgivingStrategy :: [Char] -> [Char] -> Int -> [Char]
|
forgivingStrategy :: [Char] -> [Char] -> Int -> [Char]
|
||||||
forgivingStrategy opponentMoves generatedMoves n
|
forgivingStrategy opponentMoves generatedMoves n
|
||||||
| n > 100 || length opponentMoves == 1 = generatedMoves
|
| n > 100 || length opponentMoves == 1 = generatedMoves
|
||||||
| n == 0
|
| n == 0
|
||||||
= forgivingStrategy opponentMoves (generatedMoves ++ ['С']) (n + 1)
|
= forgivingStrategy opponentMoves (generatedMoves ++ ['С']) (n + 1)
|
||||||
| head opponentMoves == 'С'
|
| head opponentMoves == 'С'
|
||||||
= forgivingStrategy (tail opponentMoves) (generatedMoves ++ ['С']) (n + 1)
|
= forgivingStrategy (tail opponentMoves) (generatedMoves ++ ['С']) (n + 1)
|
||||||
| otherwise
|
| otherwise
|
||||||
= forgivingStrategy (tail opponentMoves) (generatedMoves ++ ['П']) (n + 1)
|
= forgivingStrategy (tail opponentMoves) (generatedMoves ++ ['П']) (n + 1)
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
\subsubsection{Подсчёт очков}
|
\subsubsection{Подсчёт очков}
|
||||||
|
|||||||
Reference in New Issue
Block a user