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
+1 -1
Submodule pytron updated: 28e8aae4ee...aa5b65aecc
+2
View File
@@ -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),