Day 22.1
change
commit 8d12d532cd268400ec364bb2a23b2b47c45f78b4
author Alpha Chen <alpha.chen@gmail.com>
date
parent 939a723e
diff --git a/ruby/day_22.rb b/ruby/day_22.rb
index aca6dd0..e2e61b2 100644
--- a/ruby/day_22.rb
+++ b/ruby/day_22.rb
@@ -60,6 +60,9 @@ class Simulation
         spell = spells.shift
         throw :done if spell.nil?
 
+        self.player.hp -= 1
+        throw :done if self.player.hp <= 0
+
         self.apply_effects
         self.cast(spell)
         self.check!