Avoid starting on same position

This commit is contained in:
Pytron 2019-03-26 17:07:40 +00:00
parent 2dde0ed3d9
commit b93a7c3f39
2 changed files with 3 additions and 1 deletions

2
pytron

@ -1 +1 @@
Subproject commit 28e8aae4ee2b582cbabad44484e05a50ded0bd0f Subproject commit aa5b65aeccda3858127ebb01a639e99c0d38ae7c

View File

@ -43,6 +43,8 @@ def run_battle(ai1, ai2):
for _ in range(games): for _ in range(games):
initial_position_one = [random.randint(0, width - 1), random.randint(0, height - 1)] 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)] 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, [ game = Game(width, height, [
PositionPlayer(1, ai1.builder(), initial_position_one), PositionPlayer(1, ai1.builder(), initial_position_one),