mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-11-15 09:21:25 +00:00
15 lines
No EOL
257 B
Ruby
15 lines
No EOL
257 B
Ruby
class Array
|
|
def mda(*mds)
|
|
count = -1
|
|
|
|
mdarray = lambda { |*ds|
|
|
Array.new( ds.shift || 0 ).collect {
|
|
x = mdarray[*ds] unless ds.empty?
|
|
if x == nil then count += 1; x = self.at(count); end
|
|
x
|
|
}
|
|
}
|
|
|
|
mdarray.call(*mds)
|
|
end
|
|
end |