Skip to content

Commit 35c5616

Browse files
authored
[D&D Character] fix typos in approaches (#4122)
1 parent 8afbabe commit 35c5616

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

exercises/practice/dnd-character/.approaches/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class Character:
229229
self.hitpoints = modifier(self.constitution) + 10
230230
```
231231

232-
Listing out each ability vs looping through and using `setatter()` has identical results for the object.
232+
Listing out each ability vs looping through and using `setattr()` has identical results for the object.
233233
Both calculate a score for an ability and write that ability + score into the object attribute dictionary when an object is instantiated from the class.
234234

235235

@@ -241,7 +241,7 @@ More variations are possible, but these cover most of the main decision differen
241241
- [One `ability` method][approach-ability-method]
242242
- [Dice roll static method][approach-dice-roll-static-method]
243243
- [Dice roll stand-alone method][approach-stand-alone-dice-roll-function]
244-
- [Loop and `setatter()` in `__init__`][approach-loop-and-setattr-in-init]
244+
- [Loop and `setattr()` in `__init__`][approach-loop-and-setattr-in-init]
245245

246246

247247
[approach-ability-method]: https://exercism.org/tracks/python/exercises/dnd-character/approaches/ability-method

exercises/practice/dnd-character/.approaches/loop-and-setattr-in-init/content.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def modifier(constitution):
2828

2929

3030
This approach uses a `tuple` to hold character attributes in a [`class variable`][class-variable] or `class attribute`.
31-
Since this variable is common to all instances of the class, it can be looped through during object initialization to create instance variables and assign them values using [`setattr][setattr].
31+
Since this variable is common to all instances of the class, it can be looped through during object initialization to create instance variables and assign them values using [`setattr`][setattr].
3232

3333
This strategy has several benefits:
3434
1. The `__init__` is less verbose and the abilities are easier to maintain.
@@ -75,7 +75,7 @@ Making the character attributes a constant has the advantage of being visible to
7575
This also avoids having to reference the Character class when using or modifying the abilities and could help with clarity and maintenance in the larger program.
7676
However, modifying the abilities in this context would also be visible at the module level, and could have wide or unintended consequences, so should be commented/documented carefully.
7777

78-
The remainder of the class body is the same as in the [dice roll static method][approach-dice-roll-static-method] approach (_as is the variant below_).
78+
The remainder of the class body is the same as in the [dice roll static method][approach-dice-roll-static-method] approach.
7979

8080

8181
[approach-dice-roll-static-method]: https://exercism.org/tracks/python/exercises/dnd-character/approaches/dice-roll-static-method

0 commit comments

Comments
 (0)