Mosaic App

I think it might be easier to modify the puzzle app. You could remove all of the code that deals with generating puzzle pieces (most of the code), and swap it out with code that generates rectangles instead. Then the rest of the code should be the same.

The source of that app is here: