Skip to content

Commit 91e048f

Browse files
Create instructions.md
1 parent f2a7ef8 commit 91e048f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## Instructions
2+
3+
Mary is a big fan of the TV series Star Trek: The Next Generation. She often plays pen-and-paper role playing games, where she and her friends pretend to be the crew of the Starship Enterprise. Mary's character is Captain Picard, which means she has to keep the captain's log. She loves the creative part of the game, but doesn't like to generate random data on the spot.
4+
5+
Help Mary by creating random generators for data commonly appearing in the captain's log.
6+
### 1. Generate a random starship registry number
7+
8+
Enterprise (registry number NCC-1701) is not the only starship flying around! When it rendezvous with another starship, Mary needs to log the registry number of that starship.
9+
10+
Registry numbers start with the prefix "NCC-" and then use a number from 1000 to 9999 (both inclusive).
11+
12+
Implement the randomShipRegistryNumber() function that returns a random starship registry number.
13+
```javascript
14+
randomShipRegistryNumber()
15+
// => "NCC-1947"
16+
```
17+
### 2. Generate a random stardate
18+
19+
What's the use of a log if it doesn't include dates?
20+
21+
A stardate is a floating point number. The adventures of the Starship Enterprise from the first season of The Next Generation take place between the stardates 41000.0 and 42000.0. The "4" stands for the 24th century, the "1" for the first season.
22+
23+
Implement the function randomStardate that returns a floating point number between 41000.0 (inclusive) and 42000.0 (exclusive).
24+
25+
```javascript
26+
randomStardate()
27+
// => 41458.15721310934
28+
```
29+
### 3. Generate a random planet
30+
31+
The Starship Enterprise encounters many planets in its travels. Planets in the Star Trek universe are split into categories based on their properties. For example, Earth is a class M planet. All possible planetary classes are: D, H, J, K, L, M, N, R, T, and Y.
32+
33+
Implement the randomPlanetClassfunction. It should return one of the planetary classes at random.
34+
```javascript
35+
randomPlanetClass()
36+
// => "K"
37+
```

0 commit comments

Comments
 (0)