Skip to content

Instantly share code, notes, and snippets.

@sohnryang
Created February 26, 2017 03:40
Show Gist options
  • Save sohnryang/9780fe3baba316cce310de7874d34304 to your computer and use it in GitHub Desktop.
Save sohnryang/9780fe3baba316cce310de7874d34304 to your computer and use it in GitHub Desktop.
Rubywarrior level 4
class Player
def play_turn(warrior)
if warrior.feel.empty?
if warrior.health < 20 && @health <= warrior.health
warrior.rest!
else
warrior.walk!
end
else
warrior.attack!
end
@health = warrior.health
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment