Created
August 8, 2013 08:08
-
-
Save jansanchez/6182598 to your computer and use it in GitHub Desktop.
Ruby Warrior - Level 8
This file contains 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
# ruby warrior level 8 | |
# | |
class Player | |
def play_turn(warrior) | |
@health = warrior.health | |
if warrior.feel.captive? | |
warrior.rescue! | |
@shooter = true | |
else | |
if warrior.look[1].enemy? | |
warrior.shoot! | |
else | |
warrior.walk! | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment