Skip to content

Commit 32fe0da

Browse files
authored
docs: improve wording for troy excercise (#951)
1 parent 35ed06f commit 32fe0da

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

exercises/concept/power-of-troy/.docs/instructions.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,18 @@ The first one is related to creating a human, the other five are about handling
1313

1414
## 1. Bring humans to the world of Troy
1515

16-
For your model of Troy humans are the most important feature.
16+
For your model of Troy, humans are the most important feature.
1717
Your model human should be able to possess a _unique artifact_.
1818
They should also have the ability to manifest a _power_.
1919
These powers might affect other humans, so you also want to model if a human is influenced by some other power.
2020

2121
You are provided with basic implementations of `artifact` and `power` structs.
22-
Implement a `human` struct (or class) that has a _smart-pointer_ to an `artifact` as `possession` member variable.
22+
Implement a `human` struct (or class) that has a _smart-pointer_ to an `artifact` member variable named `possession`.
2323
Each artifact can only be possessed by a single human at any given time.
2424

25-
The `human` should also have variables for their `own_power` and `influenced_by`, which should be _smart-pointers_ to `powers`.
25+
A `human` must have two additional member variables.
26+
One holds their `own_power` and the other is a power they are `influenced_by`.
27+
Both `own_power` and `influenced_by` are _smart-pointers_ to `powers`.
2628
Each `power` might be owned by a single human, but also influence other humans at the same time.
2729

2830
By default, humans are born without any artifact and neither own any powers nor are they influenced by them.
@@ -42,7 +44,7 @@ mindy_mccready.influenced_by;
4244
Your model is boring without the interaction of its parts.
4345
You want to create unique artifacts and give them to certain humans.
4446

45-
Define the function `give_new_artifact` which returns nothing but takes a `human` and a `string`.
47+
Define the function `give_new_artifact` which returns nothing but takes a reference to a `human` and a `string`.
4648
With the `string` it should define a new `artifact` object and set the `possession` pointer of the `human` accordingly.
4749
The function should not return anything.
4850

@@ -80,10 +82,10 @@ uzumaki.possession->name;
8082

8183
## 4. Give Power to the People
8284

83-
The most exiting feature of Troy are the special powers, that people might wield.
85+
The most exciting feature of Troy are the special powers that people might wield.
8486
Some can smelt iron with their thoughts, while others can heal every wound instantly at nighttime.
8587

86-
Define the function `manifest_power` which returns nothing but takes a `human` and a `string`.
88+
Define the function `manifest_power` which returns nothing but takes a reference to a `human` and a `string`.
8789
With the `string` it should define a new `power` object and set the `own_power` pointer of the `human` accordingly.
8890
The function should not return anything.
8991

@@ -100,10 +102,12 @@ eleven.own_power->effect;
100102
What use are the greatest powers, if you cannot use them.
101103
Your model concentrates on humans, so you want to track the influence of powers.
102104
103-
Write a _void_ function `use_power` that takes two humans, first: a caster and secondly: a target.
105+
Write a _void_ function `use_power` that takes two references to humans.
106+
The first human is the caster and the second represents the target.
104107
The target's `influenced_by` pointer should be pointed to the power of the caster.
105108
106-
For simplicity, humans can only be influenced by a single power and this power stays in place even if the caster does not exist any longer.
109+
For simplicity, humans can only be influenced by a single power.
110+
This power stays in place even if the caster does not exist any longer.
107111
108112
```cpp
109113
human pamela_isley{};

0 commit comments

Comments
 (0)