Subject: Re: Making an array wrap, where last index + 1 = first index
From: Aldric Giacomoni <aldric trevoke.net>
Date: Wed, 16 Sep 2009 04:27:01 +0900
References: 346499346507
In-reply-to: 346507
def class Array2D < Array
def []( index )
super [] index % self.length
end
end
How about that?
--
Posted via http://www.ruby-forum.com/.