var SPACE_FOR_BRICKS = getWidth() - (NUM_BRICKS_PER_ROW + 1) * BRICK_SPACING; var BRICK_WIDTH = SPACE_FOR_BRICKS / NUM_BRICKS_PER_ROW; ...