Notes/Hints/Suggestions for the Recursive Buggle Quilts problem

There are two main ways to decompose the recursive bagel quilt design. Either decomposition is equally viable.

  1. Recursive Rug Decomposition: define the quilt as a square rug that has triangles at all four corners and has a smaller rug at its center. For example, here is the outer ring of such a decomposition in a 16x16 grid:

     

  2. Repeated Recursive Quadrant Decomposition: define the quilt as four rotated copies of a recursively defined quadrant consisting of a sequence of smaller and smaller triangles. For example, here is the quadrant for such a decomposition in a 16x16 grid.

 

The mathematics of the problem are a little bit tricky. The following facts are likely to be extremely useful for you. Suppose that:

(You don't need to have variables with these names in your program. They are used here for the sake of discussion.) Observe the following:

The above facts are all the math you should need in order to solve the problem using the recursive quilt decomposition. In particular, it is not necessary to test for evenness or oddness (though you may do so if you like). The calculation of triSide and inStep should be helpful even if you are using the repeated recursive quadrant decomposition.