Skip to content

Commit a4f198b

Browse files
authored
Move from classes to elons-toy-car slug (exercism#1924)
1 parent 2e955f5 commit a4f198b

11 files changed

Lines changed: 35 additions & 35 deletions

File tree

config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@
7979
"status": "wip"
8080
},
8181
{
82-
"slug": "classes",
82+
"slug": "elons-toy-car",
83+
"name": "Elon's Toy Car",
8384
"uuid": "2ae791e9-eb7a-4344-841d-0c4797e5106c",
8485
"concepts": [
8586
"classes"
File renamed without changes.

exercises/concept/classes/.docs/instructions.md renamed to exercises/concept/elons-toy-car/.docs/instructions.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,38 @@ You have six tasks, each of which will work with remote controlled car instances
1515

1616
## 1. Buy a brand-new remote controlled car
1717

18-
Implement the (_static_) `RemoteControlCar.buy()` method to return a brand-new remote controlled car instance:
18+
Implement the (_static_) `ElonsToyCar.buy()` method to return a brand-new remote controlled car instance:
1919

2020
```java
21-
RemoteControlCar car = RemoteControlCar.buy();
21+
ElonsToyCar car = ElonsToyCar.buy();
2222
```
2323

2424
## 2. Display the distance driven
2525

26-
Implement the `RemoteControlCar.distanceDisplay()` method to return the distance as displayed on the LED display:
26+
Implement the `ElonsToyCar.distanceDisplay()` method to return the distance as displayed on the LED display:
2727

2828
```java
29-
RemoteControlCar car = RemoteControlCar.buy();
29+
ElonsToyCar car = ElonsToyCar.buy();
3030
car.distanceDisplay();
3131
// => "Driven 0 meters"
3232
```
3333

3434
## 3. Display the battery percentage
3535

36-
Implement the `RemoteControlCar.batteryDisplay()` method to return the distance as displayed on the LED display:
36+
Implement the `ElonsToyCar.batteryDisplay()` method to return the distance as displayed on the LED display:
3737

3838
```java
39-
RemoteControlCar car = RemoteControlCar.buy();
39+
ElonsToyCar car = ElonsToyCar.buy();
4040
car.batteryDisplay();
4141
// => "Battery at 100%"
4242
```
4343

4444
## 4. Update the number of meters driven when driving
4545

46-
Implement the `RemoteControlCar.drive()` method that updates the number of meters driven:
46+
Implement the `ElonsToyCar.drive()` method that updates the number of meters driven:
4747

4848
```java
49-
RemoteControlCar car = RemoteControlCar.buy();
49+
ElonsToyCar car = ElonsToyCar.buy();
5050
car.drive();
5151
car.drive();
5252
car.distanceDisplay();
@@ -55,10 +55,10 @@ car.distanceDisplay();
5555

5656
## 5. Update the battery percentage when driving
5757

58-
Update the `RemoteControlCar.drive()` method to update the battery percentage:
58+
Update the `ElonsToyCar.drive()` method to update the battery percentage:
5959

6060
```java
61-
RemoteControlCar car = RemoteControlCar.buy();
61+
ElonsToyCar car = ElonsToyCar.buy();
6262
car.drive();
6363
car.drive();
6464
car.batteryDisplay();
@@ -67,10 +67,10 @@ car.batteryDisplay();
6767

6868
## 6. Prevent driving when the battery is drained
6969

70-
Update the `RemoteControlCar.drive()` method to not increase the distance driven nor decrease the battery percentage when the battery is drained (at 0%):
70+
Update the `ElonsToyCar.drive()` method to not increase the distance driven nor decrease the battery percentage when the battery is drained (at 0%):
7171

7272
```java
73-
RemoteControlCar car = RemoteControlCar.buy();
73+
ElonsToyCar car = ElonsToyCar.buy();
7474

7575
// Drain the battery
7676
// ...
File renamed without changes.

exercises/concept/classes/.meta/config.json renamed to exercises/concept/elons-toy-car/.meta/config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
],
66
"files": {
77
"solution": [
8-
"src/main/java/RemoteControlCar.java"
8+
"src/main/java/ElonsToyCar.java"
99
],
1010
"test": [
11-
"src/test/java/RemoteControlCarTest.java"
11+
"src/test/java/ElonsToyCarTest.java"
1212
],
1313
"exemplar": [
14-
".meta/src/reference/java/RemoteControlCar.java"
14+
".meta/src/reference/java/ElonsToyCar.java"
1515
]
1616
},
1717
"authors": [
File renamed without changes.

exercises/concept/classes/.meta/src/reference/java/RemoteControlCar.java renamed to exercises/concept/elons-toy-car/.meta/src/reference/java/ElonsToyCar.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class RemoteControlCar {
1+
class ElonsToyCar {
22
private int batteryPercentage = 100;
33
private int distanceDrivenInMeters = 0;
44

@@ -21,7 +21,7 @@ public String batteryDisplay() {
2121
return "Battery at " + batteryPercentage + "%";
2222
}
2323

24-
public static RemoteControlCar buy() {
25-
return new RemoteControlCar();
24+
public static ElonsToyCar buy() {
25+
return new ElonsToyCar();
2626
}
2727
}
File renamed without changes.

exercises/concept/classes/src/main/java/RemoteControlCar.java renamed to exercises/concept/elons-toy-car/src/main/java/ElonsToyCar.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
public class RemoteControlCar {
2-
public static RemoteControlCar buy() {
1+
public class ElonsToyCar {
2+
public static ElonsToyCar buy() {
33
throw new UnsupportedOperationException("Please implement the (static) RemoteControlCar.buy() method");
44
}
55

exercises/concept/classes/src/test/java/RemoteControlCarTest.java renamed to exercises/concept/elons-toy-car/src/test/java/ElonsToyCarTest.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,47 @@
33

44
import static org.assertj.core.api.Assertions.*;
55

6-
public class RemoteControlCarTest {
6+
public class ElonsToyCarTest {
77
@Test
88
public void buy_new_car_returns_instance() {
9-
RemoteControlCar car = RemoteControlCar.buy();
9+
ElonsToyCar car = ElonsToyCar.buy();
1010
assertThat(car).isNotNull();
1111
}
1212

1313
@Ignore("Remove to run test")
1414
@Test
1515
public void buy_new_car_returns_new_car_each_time() {
16-
RemoteControlCar car1 = RemoteControlCar.buy();
17-
RemoteControlCar car2 = RemoteControlCar.buy();
16+
ElonsToyCar car1 = ElonsToyCar.buy();
17+
ElonsToyCar car2 = ElonsToyCar.buy();
1818
assertThat(car1).isNotEqualTo(car2);
1919
}
2020

2121
@Ignore("Remove to run test")
2222
@Test
2323
public void new_car_distance_display() {
24-
RemoteControlCar car = new RemoteControlCar();
24+
ElonsToyCar car = new ElonsToyCar();
2525
assertThat(car.distanceDisplay()).isEqualTo("Driven 0 meters");
2626
}
2727

2828
@Ignore("Remove to run test")
2929
@Test
3030
public void new_car_battery_display() {
31-
RemoteControlCar car = new RemoteControlCar();
31+
ElonsToyCar car = new ElonsToyCar();
3232
assertThat(car.batteryDisplay()).isEqualTo("Battery at 100%");
3333
}
3434

3535
@Ignore("Remove to run test")
3636
@Test
3737
public void distance_display_after_driving_once() {
38-
RemoteControlCar car = new RemoteControlCar();
38+
ElonsToyCar car = new ElonsToyCar();
3939
car.drive();
4040
assertThat(car.distanceDisplay()).isEqualTo("Driven 20 meters");
4141
}
4242

4343
@Ignore("Remove to run test")
4444
@Test
4545
public void distance_display_after_driving_multiple_times() {
46-
RemoteControlCar car = new RemoteControlCar();
46+
ElonsToyCar car = new ElonsToyCar();
4747

4848
for (int i = 0; i < 17; i++) {
4949
car.drive();
@@ -55,7 +55,7 @@ public void distance_display_after_driving_multiple_times() {
5555
@Ignore("Remove to run test")
5656
@Test
5757
public void battery_display_after_driving_once() {
58-
RemoteControlCar car = new RemoteControlCar();
58+
ElonsToyCar car = new ElonsToyCar();
5959
car.drive();
6060

6161
assertThat(car.batteryDisplay()).isEqualTo("Battery at 99%");
@@ -64,7 +64,7 @@ public void battery_display_after_driving_once() {
6464
@Ignore("Remove to run test")
6565
@Test
6666
public void battery_display_after_driving_multiple_times() {
67-
RemoteControlCar car = new RemoteControlCar();
67+
ElonsToyCar car = new ElonsToyCar();
6868

6969
for (int i = 0; i < 23; i++) {
7070
car.drive();
@@ -76,7 +76,7 @@ public void battery_display_after_driving_multiple_times() {
7676
@Ignore("Remove to run test")
7777
@Test
7878
public void battery_display_when_battery_empty() {
79-
RemoteControlCar car = new RemoteControlCar();
79+
ElonsToyCar car = new ElonsToyCar();
8080

8181
// Drain the battery
8282
for (int i = 0; i < 100; i++) {
@@ -92,7 +92,7 @@ public void battery_display_when_battery_empty() {
9292
@Ignore("Remove to run test")
9393
@Test
9494
public void distance_display_when_battery_empty() {
95-
RemoteControlCar car = new RemoteControlCar();
95+
ElonsToyCar car = new ElonsToyCar();
9696

9797
// Drain the battery
9898
for (int i = 0; i < 100; i++) {

0 commit comments

Comments
 (0)