 Sample image
The task is to demonstrate the creation of a series of vertical pinstripes across the entire width of the display.

 in the first quarter the pinstripes should alternate one pixel white, one pixel black = 1 pixel wide vertical pinestripes
 Quarter of the way down the display, we can switch to a wider 2 pixel wide vertical pinstripe pattern, alternating two pixels white, two pixels black. 
 Half way down the display, we switch to 3 pixels wide, 
 for the lower quarter of the display we use 4 pixels.


c.f. Colour_pinstripe/Display

 
#include<graphics.h>
#include<conio.h>
 
#define sections 4
 
int main()
{
	int d=DETECT,m,maxX,maxY,x,y,increment=1;
	initgraph(&d,&m,"c:/turboc3/bgi");
 
	maxX = getmaxx();
	maxY = getmaxy();
 
	for(y=0;y<maxY;y+=maxY/sections)
	{
		for(x=0;x<maxX;x+=increment)
		{
			setfillstyle(SOLID_FILL,(x/increment)%2==0?BLACK:WHITE); //The only line which differs
			bar(x,y,x+increment,y+maxY/sections);
		}
		increment++;
	}
 
	getch();
	closegraph();
	return 0;
}
 