Ruby Warrior is a game that teach you how to programming with Ruby, and also how to write AI script.
Install
gem install rubywarrior rubywarrior
And you will have a player.rb script and README,
sample code for player.rb
def play_turn(warrior)
if warrior.feel.empty?
warrior.attack!
elsif warrior.health <= 5
warrior.rest!
else
warrior.walk!
end
end
follow the instruction to implement player.rb, then run the rubywarrior to start fighting with your warrior!!
No comments:
Post a Comment