Creating stackable items in an array

The solution was a for loop a couple booleans and index checkers.