I tested this:

pyramid_lvl[level][i] is 0
pyramid[level-1][i] is 1
pyramid[level-1][i-1] is 1

Turns out that pyramid[level-1][i] was actually nil... which makes
this a logical error, not a syntax error.

So I pretty much just waisted your time, but so long and thanks for
all the fish.