Avoid starting on same position
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user