On Tue, Jul 10, 2012 at 12:39 PM, Sebastjan H. <lists / ruby-forum.com> wrote:
> Yes, that would be ok, but that means that the player has to create all
> beasts themselves. I would like to have the beasts and later also some
> spells generated randomly and have them available for player to choose
> which ones they will use.
>
> Like so:
>
> 1. generate 10 beasts
> 2. generate 10 spells
>
> have these available in either arrays of hashes and then decide each
> turn which one to use.

You can do that easily:

beasts = %w{derimor barador}.map {|name| Blue_Scale_DRAGON.new name}
puts "Choose beast to summon:"
beasts.each_with_index {|b,i| puts "#{i+1}.- #{b.dragon_name}"}
beast = beasts[(gets.to_i) - 1]


Jesus.