From d1a2b50d56ad9d1de21b682031f7a2281e13fde3 Mon Sep 17 00:00:00 2001 From: Gerald Senarclens de Grancy Date: Tue, 19 Nov 2024 21:04:21 +0100 Subject: [PATCH 1/2] fixed missing closing tag for testcase thanks to Manuel Grobbauer for pointing this out --- exercises/concept/speedywagon/speedywagon_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/concept/speedywagon/speedywagon_test.cpp b/exercises/concept/speedywagon/speedywagon_test.cpp index 6d3f1f34a..32c91f0b3 100644 --- a/exercises/concept/speedywagon/speedywagon_test.cpp +++ b/exercises/concept/speedywagon/speedywagon_test.cpp @@ -34,7 +34,7 @@ TEST_CASE("activity_counter: sum for a nullptr", "[task_2]") { REQUIRE(speedywagon::activity_counter(nullptr, 0) == 0); } -TEST_CASE("alarm_control: works correctly for pointer", "[task_3") { +TEST_CASE("alarm_control: works correctly for pointer", "[task_3]") { speedywagon::pillar_men_sensor* kars_in_space{nullptr}; REQUIRE_FALSE(speedywagon::alarm_control(kars_in_space)); } From 6dbc8dfe1d084eeef7d4d7422579372408fe9c69 Mon Sep 17 00:00:00 2001 From: Gerald Senarclens de Grancy Date: Wed, 19 Mar 2025 22:55:44 +0100 Subject: [PATCH 2/2] attempted to improve wording started by fixing a typo (exiting -> exciting) but then tried to reduce the length of some sentences; added hints that references are expected where appropriate to allow the reader to focus on the problem at hand --- .../power-of-troy/.docs/instructions.md | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/exercises/concept/power-of-troy/.docs/instructions.md b/exercises/concept/power-of-troy/.docs/instructions.md index 84662691f..b4eb37608 100644 --- a/exercises/concept/power-of-troy/.docs/instructions.md +++ b/exercises/concept/power-of-troy/.docs/instructions.md @@ -13,16 +13,18 @@ The first one is related to creating a human, the other five are about handling ## 1. Bring humans to the world of Troy -For your model of Troy humans are the most important feature. +For your model of Troy, humans are the most important feature. Your model human should be able to possess a _unique artifact_. They should also have the ability to manifest a _power_. These powers might affect other humans, so you also want to model if a human is influenced by some other power. You are provided with basic implementations of `artifact` and `power` structs. -Implement a `human` struct (or class) that has a _smart-pointer_ to an `artifact` as `possession` member variable. +Implement a `human` struct (or class) that has a _smart-pointer_ to an `artifact` member variable named `possession`. Each artifact can only be possessed by a single human at any given time. -The `human` should also have variables for their `own_power` and `influenced_by`, which should be _smart-pointers_ to `powers`. +A `human` must have two additional member variables. +One holds their `own_power` and the other is a power they are `influenced_by`. +Both `own_power` and `influenced_by` are _smart-pointers_ to `powers`. Each `power` might be owned by a single human, but also influence other humans at the same time. 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; Your model is boring without the interaction of its parts. You want to create unique artifacts and give them to certain humans. -Define the function `give_new_artifact` which returns nothing but takes a `human` and a `string`. +Define the function `give_new_artifact` which returns nothing but takes a reference to a `human` and a `string`. With the `string` it should define a new `artifact` object and set the `possession` pointer of the `human` accordingly. The function should not return anything. @@ -80,10 +82,10 @@ uzumaki.possession->name; ## 4. Give Power to the People -The most exiting feature of Troy are the special powers, that people might wield. +The most exciting feature of Troy are the special powers that people might wield. Some can smelt iron with their thoughts, while others can heal every wound instantly at nighttime. -Define the function `manifest_power` which returns nothing but takes a `human` and a `string`. +Define the function `manifest_power` which returns nothing but takes a reference to a `human` and a `string`. With the `string` it should define a new `power` object and set the `own_power` pointer of the `human` accordingly. The function should not return anything. @@ -100,10 +102,12 @@ eleven.own_power->effect; What use are the greatest powers, if you cannot use them. Your model concentrates on humans, so you want to track the influence of powers. -Write a _void_ function `use_power` that takes two humans, first: a caster and secondly: a target. +Write a _void_ function `use_power` that takes two references to humans. +The first human is the caster and the second represents the target. The target's `influenced_by` pointer should be pointed to the power of the caster. -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. +For simplicity, humans can only be influenced by a single power. +This power stays in place even if the caster does not exist any longer. ```cpp human pamela_isley{};