Mike Nelson <miken700 / yahoo.com> writes:

> # This is taken a step further in that the spaces between each number 
> # can be zeros as well, like,

This with the zeros is what I did in my first solution; however, I
didn't think of this trick, letting the hash's default values fill in
the rest.

> # Also the zeros are not explicitly set but are implemented in the
> # hash's default value block (each row is a hash). This also handles
> # values outside of the specified size range and returns 0 to handle
> # edge cases for the final row. Also this handles mirroring of the
> # pyramid as only the left half (including the middle column) is
> # stored in the hash rows. This allows the filling out of the
> # pyramid section to only operate on the left half as an
> # optimization.

I think we might get a nice solution combining this trick with the
object I used in my second solution that behaved like 0 with regards
to arithmetic, but had a to_s method that returned "".

I do worry about the memory used by your solution, since you need to
have half of the whole tree in memory at once.