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 (Math.floor(Math.random() * MAX_GALAXY) + 1) * MIN_STAR + galaxy;
10const randomPlanetName = star =>
11 (Math.floor(Math.random() * MAX_STAR) + 1) * (MAX_STAR + 1) + star;
13const getSpawnCandidate = point =>
14 point >= MIN_GALAXY && point < MIN_STAR
15 ? randomStarName(point)
16 : randomPlanetName(point);
18export { 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