Исправил отступы в коде прощающей стратегии

This commit is contained in:
2024-11-14 19:50:09 +03:00
parent 5bad80df69
commit ee1bcd7551

View File

@@ -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{Подсчёт очков}