24 lines
457 B
Python
24 lines
457 B
Python
from random import randint, expovariate, seed
|
|
from data import save
|
|
from poisson import poisson
|
|
|
|
|
|
MINIMUM_DISTANCE_BETWEEN_STARS = 160
|
|
WIDTH, HEIGHT = 10240, 7680
|
|
|
|
|
|
seed(23)
|
|
|
|
print('Generating data.')
|
|
state = dict(
|
|
width = WIDTH,
|
|
height = HEIGHT,
|
|
stars = {
|
|
(x, y): round(1 + expovariate(1))
|
|
for x, y in poisson(WIDTH, HEIGHT, MINIMUM_DISTANCE_BETWEEN_STARS)
|
|
},
|
|
)
|
|
|
|
print('Saving game.state')
|
|
save('game.state', state)
|