From f65412ab00da394cc56c41942123d5674850aa99 Mon Sep 17 00:00:00 2001 From: Flavio Poletti Date: Fri, 7 Jan 2022 18:41:41 +0100 Subject: [PATCH] Update AI for Awari --- 04_Awari/perl/awari.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/04_Awari/perl/awari.pl b/04_Awari/perl/awari.pl index 3d70452c..b3e30b54 100644 --- a/04_Awari/perl/awari.pl +++ b/04_Awari/perl/awari.pl @@ -190,7 +190,8 @@ sub computer_move ($board, $failures, $moves) { # be obtained by setting the ORIGINAL environment variable to a # "true" value (in Perl terms). Otherwise it is calculated # according to the real rules for the game. - my $p_score = $ENV{ORIGINAL} ? $landing > 13 : int(($landing - 5) / 14); + my $p_score = $ENV{ORIGINAL} ? $landing > 13 + : ($landing + 1) % 14 > 6; # whatever, the landing position must be within the bounds $landing %= 14;