Skip to content

Commit d25d85e

Browse files
committed
further fixes and updated last exercise
1 parent 92ecfba commit d25d85e

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

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

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ Your friend is a train driver and has to drive cargo trains between cities.
44
Although your friend isn't amazing with handling the computers and would like some help with it.
55
Your friend would like your help organizing the train and correcting mistakes in the data.
66

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

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

14-
Your friend has been keeping track of eachs wagon identifer. Although they are not sure how many wagons and would like the data to be returned as an array.
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.
1514

16-
Implement a function `getListOfWagons` that accepts an unknown amount of possitve whole numbers that contains the id of each wagon.
15+
Implement a function `getListOfWagons` that accepts an unknown amount of positive whole numbers that contains the id of each wagon.
1716
It should return an array of all the wagon ids.
1817

1918
```javascript
@@ -24,9 +23,9 @@ getListOfWagons(1, 7, 12, 3, 14, 8, 5);
2423
## 2. Move the first two elements to the end of the array
2524

2625
Now that you got a general feel for handling your friend's data.
27-
The train id system works by the locomotive having id one and the rest of the wagons geting a random id.
28-
You friend had to connect two new wagons to the train and forgot to update the id system.
29-
Now the first two wagons in the array has to be moved to the back of the train.
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.
3029
Your friend would like you to move the first two wagons to the end of the array.
3130

3231
Implement a function `fixListOfWagons` that accepts an array of the id of each wagon.
@@ -44,7 +43,7 @@ Your friend realized that all data wasn't added and found another array which co
4443
Your friend would like you to add the missing values to the array.
4544
All they can remember is that the missing values should be placed after the locomotive in the array.
4645

47-
Given this new information, write a function called `CorrectListOfWagons` that takes two arrays which have the id of of each wagon as an argument.
46+
Given this new information, write a function called `CorrectListOfWagons` that takes two arrays which have the id of each wagon as an argument.
4847
The second array should be added after the first element of the first array.
4948

5049
```javascript
@@ -65,31 +64,31 @@ The first object contains which city the train should go between and the second
6564
The function should return an object with the updated routing information.
6665

6766
```exercism/note
68-
The variable `moreRouteInformation` can contain diffrent properties.
67+
The variable `moreRouteInformation` can contain different properties.
6968
```
7069

7170
```javascript
7271
route = {from: "Berlin", to: "Hamburg"};
73-
moreRouteInformation = {length: 100, speed: 50};
72+
moreRouteInformation = {length: "100", speed: "50"};
7473
extendRouteInformation(route, moreRouteInformation);
75-
// => {from: "Berlin", to: "Hamburg", length: 100, speed: 50}
74+
// => {from: "Berlin", to: "Hamburg", length: "100", speed: "50"}
7675
```
7776

78-
## 5. Remove arrival time from routing information
77+
## 5. Separate arrival time from routing information
7978

8079
Your friend has noticed that they don't need the arrival time in the routing information.
81-
Therefore your friend would like you to remove the arrival time from the routing information.
80+
Therefore your friend would like you to separate the arrival time from the routing information.
8281

83-
Implement a function `removeArrivalTime` that accepts an object with the routing information.
84-
The function should return an object
82+
Implement a function `separateArrivalTime` that accepts an object with the routing information.
83+
The function should return two objects.
8584

8685
```javascript
8786
routeInformation= {
8887
from: "Berlin",
8988
to: "Hamburg",
90-
length: 100,
89+
length: "100",
9190
timeOfArrival: "10:10"
9291
};
93-
removeTimeOfArrival(routeInformation);
94-
// => {from: "Berlin", to: "Hamburg", length: 100}
92+
separateTimeOfArrival(routeInformation);
93+
// => {timeOfArrival: "10:10"}, {from: "Berlin", to: "Hamburg", length: "100"}
9594
```

0 commit comments

Comments
 (0)