From ee1bcd7551b1ad83285da3e65f3b322a94a5cd53 Mon Sep 17 00:00:00 2001 From: Arity-T Date: Thu, 14 Nov 2024 19:50:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D1=82=D1=81=D1=82=D1=83=D0=BF=D1=8B=20=D0=B2=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=B4=D0=B5=20=D0=BF=D1=80=D0=BE=D1=89=D0=B0=D1=8E?= =?UTF-8?q?=D1=89=D0=B5=D0=B9=20=D1=81=D1=82=D1=80=D0=B0=D1=82=D0=B5=D0=B3?= =?UTF-8?q?=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lab2/report/report.tex | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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{Подсчёт очков}