Colour pinstripe/Display: Difference between revisions
Content deleted Content added
No edit summary |
|||
Line 82:
</lang>
=={{header|C}}==
The following code uses the BGI graphics library of Borland's Turbo C.
<lang C>
#include<graphics.h>
#include<conio.h>
#define sections 4
int main()
{
int d=DETECT,m,maxX,maxY,x,y,colour=0,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,(colour++)%16);
bar(x,y,x+increment,y+maxY/sections);
}
increment++;
colour = 0;
}
getch();
closegraph();
return 0;
}
</lang>
=={{header|C++}}==
[[File:clr_pinstripe_cpp.png|300px]]
Line 206 ⟶ 240:
//--------------------------------------------------------------------------------------------------
</lang>
=={{header|Common Lisp}}==
Using Allegro's Common Graphics. As stated in the comments, I'm using line drawing here
|