>
> By reading the previous you *must* be able to *study* the code and
> figure it out. This is something you will need to do more often than
> not, when you write programs. It's very rare for any programmer -
> contrary to what I used to believed before - to write code by heart and
> get it right the first time.
>
> Most of the times it takes some to search on google, read the
> documentation work through a tutorial etc. When you find a code snippet
> that does what you want but you don't understand why, try to break it
> down.
>
> So here you have a series of elements you need to print in a series.
> There are different (possible endless) approaches on how to solve this.
> @Regis d'Aubarede offered the following snippet "1.upto(6) { |i| puts "6
> 5 4 3 2 1"[2*(6-i)..12] }". Try to understand how exactly it works by
> experimenting with the code and you'll find the answer to your question,
> providing an easy-way-out at this point will do more damage than good
> IMHO.
>
> Don't give up.

I am trying to read code and understand how it is work. I will not give 
up.

Thank you for your advice.

-- 
Posted via http://www.ruby-forum.com/.