2019-03-20 11:20:10 +01:00
|
|
|
import sys, getopt, random
|
2019-03-19 18:04:43 +01:00
|
|
|
|
|
|
|
def set_home_amount():
|
|
|
|
arguments = sys.argv[1:]
|
|
|
|
try:
|
|
|
|
optlist, args = getopt.getopt(arguments, '', ['home-count='])
|
|
|
|
for o, amount in optlist:
|
|
|
|
if o == '--home-count':
|
2019-03-19 19:11:25 +01:00
|
|
|
if int(amount) < 2:
|
|
|
|
print('Home count too low - must be higher than 2')
|
|
|
|
sys.exit(2)
|
2019-03-19 18:04:43 +01:00
|
|
|
return int(amount)
|
2019-03-19 18:40:36 +01:00
|
|
|
print('Missing argument: --home-count <amount>')
|
2019-03-19 18:04:43 +01:00
|
|
|
sys.exit(2)
|
|
|
|
except getopt.GetoptError as err:
|
|
|
|
print(err)
|
|
|
|
sys.exit(2)
|
2019-03-20 11:20:10 +01:00
|
|
|
|
2019-03-20 22:36:40 +01:00
|
|
|
def generate_rand_coordinates(max_x, max_y):
|
|
|
|
return (random.randint(0, max_x), random.randint(0, (max_y)))
|
|
|
|
|