From f647c9fce529aadbc23205b624678385232ff0cb Mon Sep 17 00:00:00 2001 From: Arity-T Date: Sun, 10 Nov 2024 03:53:11 +0300 Subject: [PATCH] =?UTF-8?q?=D1=82=D0=B8=D0=BF=D1=8B=20=D0=BF=D0=BE=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=20=D0=B2=20=D0=B8=D0=B3=D1=80?= =?UTF-8?q?=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lab2/prisoner/game.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lab2/prisoner/game.hs b/lab2/prisoner/game.hs index 96adbfe..ddeb426 100644 --- a/lab2/prisoner/game.hs +++ b/lab2/prisoner/game.hs @@ -14,7 +14,7 @@ indexOf (x : xs) target | x == target = 0 | otherwise = 1 + indexOf xs target -nashEquilibriumStrategy :: [a] -> [Char] -> Int -> [Char] +nashEquilibriumStrategy :: [Char] -> [Char] -> Int -> [Char] nashEquilibriumStrategy opponentMoves generatedMoves n = if n <= 100 && length opponentMoves > 0 then @@ -29,7 +29,7 @@ nashEquilibriumStrategy opponentMoves generatedMoves n = ] nextStep = cases !! indexOf results result !! 1 -getScore :: Num t => [Char] -> [Char] -> t -> t -> (t, t) +getScore :: [Char] -> [Char] -> Int -> Int -> (Int, Int) getScore moves1 moves2 score1 score2 = if length moves1 == 0 then (score1, score2) else getScore (tail moves1) (tail moves2) newScore1 newScore2