# nested arrays to model columns and rows

@objectDisplayMatrix = Array . new ( 4 ) { Array . new ( 3 ) }

@coordinateSet = [ ]

# set the values

for column in 0 ... 4

for row in 0 ... 3

# retrieve and calculate the values for @attr0 through @attr4

# more code doing that

# |

# |

# |

# |

# this was a highly optimized for-loop

# add these attributes to the matrix

@objectDisplayMatrix [ column ] [ row ] = [ @attr0, @attr1 , @attr2 , @attr3 , @attr4 ]

end

end

# add coordinates (this was really done by user input but here's some arbitrary coordinates)

@coordinateSet . push [ 2 , 3 ]

@coordinateSet . push [ 3 , 3 ]

@coordinateSet . push [ 0 , 2 ]

# retrieve @attr1, @attr2, @attr3 from the object in the 3rd row of the 2nd column

requested_attr1 = @objectDisplayMatrix [ @coordinateSet [ 0 ] [ 0 ] ] [ @coordinateSet [ 0 ] [ 1 ] ] [ 1 ]

requested_attr2 = @objectDisplayMatrix [ @coordinateSet [ 0 ] [ 0 ] ] [ @coordinateSet [ 0 ] [ 1 ] ] [ 2 ]

requested_attr3 = @objectDisplayMatrix [ @coordinateSet [ 0 ] [ 0 ] ] [ @coordinateSet [ 0 ] [ 1 ] ] [ 3 ]