Code for Turan's Brickyard Problem