2const MIN_STAR = Math.pow(2, 8);
3const MIN_PLANET = Math.pow(2, 16);
4const MAX_GALAXY = MIN_STAR - 1;
5const MAX_STAR = MIN_PLANET - 1;
7const randomStarName = galaxy =>
8 // ( random in range 0x1 .. 0xff ) * 0x100 + 0x??
9 (Math.floor(Math.random() * MAX_GALAXY) + 1) * MIN_STAR + galaxy;
11const randomPlanetName = star =>
12 // ( random in range 0x1 .. 0xffff ) * 0x10000 + 0x????
13 (Math.floor(Math.random() * MAX_STAR) + 1) * MIN_PLANET + star;
15const getSpawnCandidate = point =>
16 point >= MIN_GALAXY && point < MIN_STAR
17 ? randomStarName(point)
18 : randomPlanetName(point);
20export { getSpawnCandidate };
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list