Skip to content

Commit e1af39e

Browse files
committed
Updated the story and added contributors
1 parent a327c00 commit e1af39e

File tree

2 files changed

+29
-23
lines changed

2 files changed

+29
-23
lines changed

exercises/concept/train-driver/.docs/instructions.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
# Instructions
22

3-
Your friend is a train driver and has to drive cargo trains between cities.
4-
Although your friend isn't amazing with handling the computers and would like some help with it.
5-
Your friend would like your help organizing the train and correcting mistakes in the data.
3+
Your friend is a Locomotive Engineer who drives cargo trains between cities.
4+
Although your friend is great handling the trains, they aren't amazing handling the logistics computers and would like your programming help organizing the train and correcting mistakes in the data.
65

76
```exercism/note
87
To practice, use the rest or spread operator to solve each of the tasks below.
98
```
109

1110
## 1. Create a list of all wagons
1211

13-
Your friend has been keeping track of each wagon identifier. Although they are not sure how many wagons and would like the data to be returned as an array.
12+
Your friend has been keeping track of each wagon identifier, but they're never sure how many wagons they are going to have to process at any given time. It would be much easier for the rest of the logistics program to have the data to be returned as an array.
1413

15-
Implement a function `getListOfWagons` that accepts an unknown amount of positive integers that contains the id of each wagon.
16-
It should return an array of all the wagon ids.
14+
Implement a function `getListOfWagons` that accepts an unknown amount of positive integers which are the IDs of each wagon.
1715

1816
```javascript
1917
getListOfWagons(1, 7, 12, 3, 14, 8, 5);
@@ -22,14 +20,15 @@ getListOfWagons(1, 7, 12, 3, 14, 8, 5);
2220

2321
## 2. Move the first two elements to the end of the array
2422

25-
Now that you got a general feel for handling your friend's data.
26-
The train id system works by the locomotive having id number one and the rest of the wagons having a random id.
27-
Your friend had to connect two new wagons to the train and forgot to update the id system.
28-
Now the first two wagons in the array have to be moved to the back of the train.
29-
Your friend would like you to move the first two wagons to the end of the array.
23+
At this point, you are starting to get a feel for your friend's data and how it's used in the logistics program.
24+
The train ID system works by assigning the locomotive an ID of `1` and then assigning the remainder of the wagons a randomly chosen ID greater than `1`.
25+
26+
But then your friend had to connect two new wagons to the train and forgot to update the system!
27+
Now the first two wagons in the `array` have to be moved to the back of the train, or everything will be out of order.
28+
Your friend would be really grateful to you for fixing their mistake.
3029

3130
Implement a function `fixListOfWagons` that accepts an array of the id of each wagon.
32-
It returns an array where the 2 first elements are moved to the end of the array.
31+
It `return` an `array` where the 2 first elements repositioned to the end of the `array`.
3332

3433
```javascript
3534
eachWagonsWieght = [2, 5, 1, 7, 4, 12, 6, 3, 13];
@@ -39,12 +38,13 @@ fixListOfWagons(eachWagonsWieght);
3938

4039
## 3. Add missing values
4140

42-
Your friend realized that all data wasn't added and found another array which contains the missing wagons.
43-
Your friend would like you to add the missing values to the array.
44-
All they can remember is that the missing values should be placed after the locomotive in the array.
41+
Uh-oh. some wagons seem to have gone missing.
42+
43+
Fortunately, your friend just found another `array` which appears to contain the missing wagon IDs, and would like you to add them into the main wagon ID `array`.
44+
All they can remember is that the missing values should be placed directly after the designated locomotive.
4545

46-
Given this new information, write a function called `CorrectListOfWagons` that takes two arrays which have the id of each wagon as an argument.
47-
The second array should be added after the first element of the first array.
46+
Given this new information, write a function called `CorrectListOfWagons` that takes two arrays which have the IDs of each wagon as the arguments.
47+
The wagon IDs of the second `array` should be added into the first `array` directly after the locomotive (ID 1).
4848

4949
```javascript
5050
eachWagonsWieght = [1, 5, 20, 7, 4, 8];
@@ -55,13 +55,15 @@ CorrectListOfWagons(eachWagonsWieght, missingWagons);
5555

5656
## 4. Extend routing information
5757

58-
Now that the wagon data is correct, your friend would like you to update the routing information.
59-
Your friend has an object with the routing information and would like you to add more routing information to the object.
60-
Every route requires a bit different information so your friend would prefer a generic solution.
58+
Now that all the wagon data is correct, your friend would like you to update the systems routing information.
59+
Initial routing information has been constructed as an `object`, and you friend would like you to update it with the additions provided.
60+
Every route requires slightly different information, so your friend would really prefer a generic solution.
61+
62+
Implement a function extendRouteInformation that accepts two `objects`.
63+
The first `object` contains which cities the train route moves between.
6164

62-
Implement a function `extendRouteInformation` that accepts two objects.
63-
The first object contains which city the train should go between and the second object contains more routing information.
64-
The function should return an object with the updated routing information.
65+
The second `object` contains other routing details such as train speed or length.
66+
The function should return a consolidated `object` with all routing information.
6567

6668
```exercism/note
6769
The variable `moreRouteInformation` can contain different properties.

exercises/concept/train-driver/.meta/config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"authors": [
33
"meatball"
44
],
5+
"contributors": [
6+
"bethanyg",
7+
"junedev"
8+
],
59
"files": {
610
"solution": [
711
"train-driver.js"

0 commit comments

Comments
 (0)