From b93a7c3f3996c6d42c1b7515960ab3615cc23565 Mon Sep 17 00:00:00 2001 From: Pytron Date: Tue, 26 Mar 2019 17:07:40 +0000 Subject: [PATCH] Avoid starting on same position --- pytron | 2 +- pytron_run/run.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pytron b/pytron index 28e8aae..aa5b65a 160000 --- a/pytron +++ b/pytron @@ -1 +1 @@ -Subproject commit 28e8aae4ee2b582cbabad44484e05a50ded0bd0f +Subproject commit aa5b65aeccda3858127ebb01a639e99c0d38ae7c diff --git a/pytron_run/run.py b/pytron_run/run.py index d487eec..431644f 100755 --- a/pytron_run/run.py +++ b/pytron_run/run.py @@ -43,6 +43,8 @@ def run_battle(ai1, ai2): for _ in range(games): initial_position_one = [random.randint(0, width - 1), random.randint(0, height - 1)] initial_position_two = [random.randint(0, width - 1), random.randint(0, height - 1)] + while initial_position_one[0] == initial_position_two[0] and initial_position_one[1] == initial_position_two[1]: + initial_position_two = [random.randint(0, width - 1), random.randint(0, height - 1)] game = Game(width, height, [ PositionPlayer(1, ai1.builder(), initial_position_one),