-
Notifications
You must be signed in to change notification settings - Fork 0
/
Star.py
78 lines (57 loc) · 2.1 KB
/
Star.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import random
class Star():
def __init__(self):
_x = random.randint(2**3, 2**64-1)
_y = random.randint(2**3, 2**64-1)
_z = random.randint(2**3, 2**64-1)
self._x = _x
self._y = _y
self._z = _z
self.isVisited = False # set to False by default
self.probeDistant = 0 # set 0 by default
def coordinateControl(self,list):
for i in range(len(list)):
if(self._x==list[i]._x and self._y==list[i]._y and self._z==list[i]._z):
while(self._x==list[i]._x and self._y==list[i]._y and self._z==list[i]._z):
_x = random.randint(2 ** 3, 2 ** 64 - 1)
_y = random.randint(2 ** 3, 2 ** 64 - 1)
_z = random.randint(2 ** 3, 2 ** 64 - 1)
self._x = _x
self._y = _y
self._z = _z
class DwarfStar(Star):
def __init__(self):
Star.__init__(self)
rangeOfPlanet = random.randint(8, 15)
goldilockZoneMin = 30
goldilockZoneMax = 90
self.lifeChance = 0.0006
self.numberPlanets = rangeOfPlanet
self.goldilockZoneMin = goldilockZoneMin
self.goldilockZoneMax = goldilockZoneMax
self.reCharge = 2**20
self.PlanetList = []
class MediumStar(Star):
def __init__(self):
Star.__init__(self)
rangeOfPlanet = random.randint(2, 9)
goldilockZoneMin = 60
goldilockZoneMax = 140
self.lifeChance = 0.0005
self.numberPlanets = rangeOfPlanet
self.goldilockZoneMin = goldilockZoneMin
self.goldilockZoneMax = goldilockZoneMax
self.reCharge = 2**30
self.PlanetList = []
class GiantStar(Star):
def __init__(self):
Star.__init__(self)
rangeOfPlanet = random.randint(5, 10)
goldilockZoneMin = 100
goldilockZoneMax = 250
self.lifeChance = 0.0009
self.numberPlanets = rangeOfPlanet
self.goldilockZoneMin = goldilockZoneMin
self.goldilockZoneMax = goldilockZoneMax
self.reCharge = 2**25
self.PlanetList = []