Guest User

Untitled

a guest
Jul 15th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. def attack! player
  2. puts "#{self.name} attacks #{player.name}!"
  3. puts ""
  4.  
  5. until self.hp <= 0 || player.hp <= 0
  6. self.hit player
  7. player.hit self
  8. end
  9.  
  10. if self.hp > 0
  11. winner = self.name
  12. else
  13. winner = player.name
  14. end
  15.  
  16. puts ""
  17. puts "The skies clear and the birds chirp as #{winner} wins!"
  18. end
Add Comment
Please, Sign In to add comment