diff --git a/lab2/report/report.tex b/lab2/report/report.tex index 1f6946b..c934c46 100644 --- a/lab2/report/report.tex +++ b/lab2/report/report.tex @@ -369,13 +369,13 @@ \begin{lstlisting}[caption={Код функции, реализующей прощающую стратегию.}, label={lst:forgivingStrategy}] forgivingStrategy :: [Char] -> [Char] -> Int -> [Char] forgivingStrategy opponentMoves generatedMoves n - | n > 100 || length opponentMoves == 1 = generatedMoves - | n == 0 - = forgivingStrategy opponentMoves (generatedMoves ++ ['С']) (n + 1) - | head opponentMoves == 'С' - = forgivingStrategy (tail opponentMoves) (generatedMoves ++ ['С']) (n + 1) - | otherwise - = forgivingStrategy (tail opponentMoves) (generatedMoves ++ ['П']) (n + 1) + | n > 100 || length opponentMoves == 1 = generatedMoves + | n == 0 + = forgivingStrategy opponentMoves (generatedMoves ++ ['С']) (n + 1) + | head opponentMoves == 'С' + = forgivingStrategy (tail opponentMoves) (generatedMoves ++ ['С']) (n + 1) + | otherwise + = forgivingStrategy (tail opponentMoves) (generatedMoves ++ ['П']) (n + 1) \end{lstlisting} \subsubsection{Подсчёт очков}