From da77edaff337e13b0eeedb3e66f8ee7f0438fe76 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Sun, 12 Jul 2026 14:54:49 +0100 Subject: [PATCH] Fix spelling of 'Wizard' --- concepts/classes/about.md | 16 ++++++++-------- concepts/classes/introduction.md | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/concepts/classes/about.md b/concepts/classes/about.md index bb94b033..a955f486 100644 --- a/concepts/classes/about.md +++ b/concepts/classes/about.md @@ -26,7 +26,7 @@ The definition of a new `class` can be seen in the following example. Notice the `;` after the definition. ```cpp -class Wizzard { +class Wizard { public: // from here on all members are accessible publicly int cast_spell() { // defines the public member function cast_spell return damage; @@ -43,7 +43,7 @@ Take a look at `damage` inside the `cast_spell` function. You cannot read or change `private` members outside of the class: ```cpp -Wizzard silverhand{}; +Wizard silverhand{}; // calling the `cast_spell` function is okay, it is public: silverhand.cast_spell(); // => 5 @@ -64,12 +64,12 @@ A class can have several constructors. This is useful if you do not always have a need to set all variables. ```cpp -class Wizzard { +class Wizard { public: - Wizzard(std::string new_name) { + Wizard(std::string new_name) { name = new_name; } - Wizzard(std::string new_name, int new_damage) { + Wizard(std::string new_name, int new_damage) { name = new_name; damage = new_damage; } @@ -81,8 +81,8 @@ class Wizzard { int damage{5}; }; -Wizzard el{"Eleven"}; // deals 5 damage -Wizzard vecna{"Vecna", 50}; // deals 50 damage +Wizard el{"Eleven"}; // deals 5 damage +Wizard vecna{"Vecna", 50}; // deals 50 damage ``` Constructors are a big topic and have many nuances. @@ -101,6 +101,6 @@ By default, everything in a `class` is `private`. Structs, on the other hand, are `public` until defined otherwise. Conventionally, the `struct` keyword is often used for **data-only structures**. The `class` keyword is preferred for objects that need to ensure certain properties. -Such an invariant could be that the `damage` of your `Wizzard` `class` cannot turn negative. +Such an invariant could be that the `damage` of your `Wizard` `class` cannot turn negative. The `damage` variable is private and any function that changes the damage would ensure the invariant is preserved. ~~~~ diff --git a/concepts/classes/introduction.md b/concepts/classes/introduction.md index e9a957bc..f85c9ea4 100644 --- a/concepts/classes/introduction.md +++ b/concepts/classes/introduction.md @@ -25,7 +25,7 @@ The definition of a new `class` can be seen in the following example. Notice the `;` after the definition. ```cpp -class Wizzard { +class Wizard { public: // from here on all members are accessible publicly int cast_spell() { // defines the public member function cast_spell return damage; @@ -42,7 +42,7 @@ Take a look at `damage` inside the `cast_spell` function. You cannot read or change `private` members outside of the class: ```cpp -Wizzard silverhand{}; +Wizard silverhand{}; // calling the `cast_spell` function is okay, it is public: silverhand.cast_spell(); // => 5 @@ -63,12 +63,12 @@ A class can have several constructors. This is useful if you do not always have a need to set all variables. ```cpp -class Wizzard { +class Wizard { public: - Wizzard(std::string new_name) { + Wizard(std::string new_name) { name = new_name; } - Wizzard(std::string new_name, int new_damage) { + Wizard(std::string new_name, int new_damage) { name = new_name; damage = new_damage; } @@ -80,8 +80,8 @@ class Wizzard { int damage{5}; }; -Wizzard el{"Eleven"}; // deals 5 damage -Wizzard vecna{"Vecna", 50}; // deals 50 damage +Wizard el{"Eleven"}; // deals 5 damage +Wizard vecna{"Vecna", 50}; // deals 50 damage ``` Constructors are a big topic and have many nuances. @@ -100,6 +100,6 @@ By default, everything in a `class` is `private`. Structs, on the other hand, are `public` until defined otherwise. Conventionally, the `struct` keyword is often used for **data-only structures**. The `class` keyword is preferred for objects that need to ensure certain properties. -Such an invariant could be that the `damage` of your `Wizzard` `class` cannot turn negative. +Such an invariant could be that the `damage` of your `Wizard` `class` cannot turn negative. The `damage` variable is private and any function that changes the damage would ensure the invariant is preserved. ~~~~