Last active
December 20, 2015 11:49
-
-
Save sukhchander/6125929 to your computer and use it in GitHub Desktop.
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
class Player | |
def play_turn(warrior) | |
# cool code goes here | |
warrior.walk! | |
end | |
end | |
class Player | |
def play_turn(warrior) | |
# cool code goes here | |
if warrior.feel.empty? | |
warrior.walk! | |
else | |
warrior.attack! | |
end | |
end | |
end | |
class Player | |
def play_turn(warrior) | |
# cool code goes here | |
if warrior.feel.empty? | |
if warrior.health < 10 | |
warrior.rest! | |
else | |
warrior.walk! | |
end | |
else | |
warrior.attack! | |
end | |
end | |
end | |
class Player | |
def play_turn(warrior) | |
# cool code goes here | |
@health = warrior.health unless @health | |
if warrior.feel.empty? | |
if warrior.health < @health | |
warrior.walk! | |
elsif warrior.health < 12 # clue is 10% | |
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