function pads = makepads(n)

[xs,ys] = makeseq(n);

% starting with a 0 pad, compute the pads for each x and y.
% a 1 in xs causes the next pad to 'flip,' a 0 causes it to stay the same.
xpad = mod(cumsum(xs),2);
ypad = mod(cumsum(ys),2);

% stretch the pads to cover the surface
xsheet = repmat(xpad,1,length(xpad));
ysheet = repmat(ypad',length(ypad),1);

pads = xor(xsheet,ysheet);
