请猛戳,很赞 https://www.bloc.io/ruby-warrior#/ 还是 Inspired by ryanb https://github.com/ryanb/ruby-warrior
class Player
@health = 0
def play_turn(warrior)
if warrior.feel.empty?
if (warrior.health < 20) && (warrior.health > @health)
@health = warrior.health
warrior.rest!
else
warrior.walk!
end
else
warrior.attack!
end
end
end
第四关的,貌似有问题 求修正!