@@ -5,10 +5,12 @@ const MAX_GALAXY = MIN_STAR - 1;
5const MAX_STAR = MIN_PLANET - 1;
5const MAX_STAR = MIN_PLANET - 1;
7const randomStarName = galaxy =>
7const randomStarName = galaxy =>
8+ // ( random in range 0x1 .. 0xff ) * 0x100 + 0x??
8 (Math.floor(Math.random() * MAX_GALAXY) + 1) * MIN_STAR + galaxy;
9 (Math.floor(Math.random() * MAX_GALAXY) + 1) * MIN_STAR + galaxy;
10const randomPlanetName = star =>
11const randomPlanetName = star =>
12+ // ( random in range 0x1 .. 0xffff ) * 0x10000 + 0x????
11− (Math.floor(Math.random() * MAX_STAR) + 1) * (MAX_STAR + 1) + star;
13+ (Math.floor(Math.random() * MAX_STAR) + 1) * MIN_PLANET + star;
13const getSpawnCandidate = point =>
15const getSpawnCandidate = point =>
14 point >= MIN_GALAXY && point < MIN_STAR
16 point >= MIN_GALAXY && point < MIN_STAR