i know how to draw a square hollow or filled

but i need to draw an alternating pattern

ex
iPatternHeight = 1
X

iPatternHeight = 3
OOO