Created
February 26, 2017 03:21
-
-
Save sohnryang/529da462cafb02544f2dd9e50f1c1b4e to your computer and use it in GitHub Desktop.
Rubywarrior level 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Player | |
def play_turn(warrior) | |
if warrior.feel.empty? | |
if warrior.health < 20 | |
warrior.rest! | |
else | |
warrior.walk! | |
end | |
else | |
warrior.attack! | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment