Skip to content

Commit edc298d

Browse files
authored
Create Ninja vs Samurai: Strike
1 parent cd3d46a commit edc298d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Ninja vs Samurai: Strike

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Warrior {
2+
constructor(name) {
3+
this.name = name;
4+
this.health = 100;
5+
}
6+
7+
strike(enemy, swings) {
8+
enemy.health = Math.max(0, enemy.health - (swings * 10));
9+
}
10+
}

0 commit comments

Comments
 (0)