We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd3d46a commit edc298dCopy full SHA for edc298d
Ninja vs Samurai: Strike
@@ -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