Skip to content

Commit cc6c360

Browse files
authored
Merge pull request ironhack-labs#2466 from ironhack-labs/uros/review
Review
2 parents c0424eb + 4df8b53 commit cc6c360

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@
66

77
We have learned Object-oriented programming and how `class` and inheritance work in JavaScript. Now lets work with our Viking friends, applying all of the concepts we have just learned.
88

9+
<br>
10+
911
## Requirements
1012

1113
- Fork this repo.
1214
- Clone this repo.
13-
- Visit the "actions" tab in your fork, and enable workflows.
15+
- Visit the "Actions" tab in your fork, and enable workflows.
16+
17+
<br>
1418

1519
## Submission
1620

@@ -24,11 +28,15 @@ $ git push origin master
2428

2529
Create Pull Request so your TAs can check up your work.
2630

31+
<br>
32+
2733
### Test, test, test!
2834

29-
Please, open your terminal, change directories into the root of the lab, and run `npm install` to install the test runner. Now, you can run the `npm run test:watch` command to run automated tests in _watch mode_. Open the resulting `lab-solution.html` file with the "Live Server" VSCode extension to always see the most up to date test results.
35+
Please, open your terminal, change directories into the root of the lab, and run `npm install` to install the test runner. Next, run the `npm run test:watch` command to run the automated tests. Open the resulting `lab-solution.html` file with the "Live Server" VSCode extension to see the test results.
3036

31-
You should see that most tests are failing. Let's work to make all of them pass!
37+
You will see that most of the tests are failing. Let's get to work to make all of them pass!
38+
39+
<br>
3240

3341
## Instructions
3442

@@ -66,6 +74,8 @@ class Saxon {}
6674
class War {}
6775
```
6876

77+
<br>
78+
6979
### Iteration 1: Soldier
7080

7181
Modify the `Soldier` class and add 2 methods to it: `attack()`, and `receiveDamage()`.
@@ -89,6 +99,8 @@ Modify the `Soldier` class and add 2 methods to it: `attack()`, and `receiveDama
8999
- should remove the received damage from the `health` property
90100
- **shouldn't return** anything
91101

102+
<br>
103+
92104
### Iteration 2: Viking
93105

94106
A `Viking` is a `Soldier` with an additional property, their `name`. They also have a different `receiveDamage()` method and new method, `battleCry()`.
@@ -132,6 +144,8 @@ Modify the `Viking` class, have it inherit from `Soldier`, re-implement the `rec
132144
- should receive **0 arguments**
133145
- should return **"Odin Owns You All!"**
134146

147+
<br>
148+
135149
### Iteration 3: Saxon
136150

137151
A `Saxon` is a weaker kind of `Soldier`. Unlike a `Viking`, a `Saxon` has no name. Their `receiveDamage()` method will also be different than the original `Soldier` version.
@@ -164,6 +178,8 @@ Modify the `Saxon`, constructor function, have it inherit from `Soldier` and re-
164178
- **if the Saxon is still alive**, it should return **_"A Saxon has received DAMAGE points of damage"_**
165179
- **if the Saxon dies**, it should return **_"A Saxon has died in combat"_**
166180

181+
<br>
182+
167183
### BONUS - Iteration 4: War
168184

169185
Now we get to the good stuff: WAR! Our `War` class will allow us to have a `Viking` army and a `Saxon` army that battle each other.
@@ -222,6 +238,8 @@ The `Saxon` version of `vikingAttack()`. A `Viking` receives the damage equal to
222238
- should remove dead vikings from the army
223239
- should return **result of calling `receiveDamage()` of a `Viking`** with the `strength` of a `Saxon`
224240

241+
<br>
242+
225243
### SUPER BONUS - Iteration 5
226244

227245
Since there is a lot of repetitive code in the previous two iterations, _vikingAttack()_ and _saxonAttack()_ try to create one _generic_ method and call it in the case of _vikingAttack_ and in the case of _saxonAttack_ instead of using almost the same code for both methods. (This iteration doesn't have test, so ask your TAs and your instructor to give you feedback on the quality of your code after the refactor.)

src/viking.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ class Saxon {}
1010
// War
1111
class War {}
1212

13-
// The following is required to make unit tests work. Please ignore it.
13+
14+
15+
// The following is required to make unit tests work.
16+
/* Environment setup. Do not modify the below code. */
1417
if (typeof module !== 'undefined') {
1518
module.exports = { Soldier, Viking, Saxon, War };
1619
}

0 commit comments

Comments
 (0)