max=9
for i in 1..8
p max-i
end


its not very ruby like. but it works

On 4/21/06, MenDAKE <mendake_ddude / yahoo.com> wrote:
> How do I get a for loop to count backwards?
>
> I have the loop...
>
> for i in 1 ... 8
>
> ...but I want it to start at 8 and end at 1. This does NOT work:
>
> for i in 8 ... 1
>
> Thanks for helping out a newbie.
>
> --
> Posted via http://www.ruby-forum.com/.
>
>