![]() |
| Spectrum |
// SPECTRUM
// SAVE PROGRAM WITH EXTENSION .CPP OR DECLARE ALL VARIABLES
// AT THE BEGIN OF MAIN FUNCTION
#include<graphics.h>
#include<dos.h>
#include<conio.h>
#include<math.h>
void main()
{
int gd = DETECT, gm;
initgraph(&gd, &gm, "c:\\turboc3\\bgi");
int x = getmaxx()/2;
int y = getmaxy()/2;
setbkcolor(WHITE);
setcolor(LIGHTBLUE);
// PRISEM
line(x, y-75, x+75, y+75);
line(x+75, y+75, x-75, y+75);
line(x-75, y+75, x, y-75);
line(x, y-75, x, y);
line(x, y, x+75, y+75);
line(x, y, x-75, y+75);
delay(500);
setcolor(YELLOW);
line(0, y+100, x-38, y);
line(0, y+101, x-38, y+1);
delay(500);
line(x-38, y, x+38, y+5);
line(x-38, y, x+38, y+6);
line(x-38, y, x+39, y+7);
line(x-38, y, x+39, y+8);
line(x-38, y, x+40, y+9);
line(x-38, y, x+40, y+10);
line(x-38, y, x+41, y+11);
delay(500);
// RED
setcolor(RED);
line(x+38, y+5, x*2, y+50);
line(x+38, y+5, x*2, y+51);
line(x+38, y+5, x*2, y+52);
line(x+38, y+5, x*2, y+53);
line(x+38, y+5, x*2, y+54);
line(x+38, y+5, x*2, y+55);
line(x+38, y+5, x*2, y+56);
// ORENGE
setcolor(LIGHTRED);
line(x+38, y+6, x*2, y+57);
line(x+38, y+6, x*2, y+58);
line(x+38, y+6, x*2, y+59);
line(x+38, y+6, x*2, y+60);
line(x+38, y+6, x*2, y+61);
line(x+38, y+6, x*2, y+62);
line(x+38, y+6, x*2, y+63);
// YELLOW
setcolor(YELLOW);
line(x+39, y+7, x*2, y+64);
line(x+39, y+7, x*2, y+65);
line(x+39, y+7, x*2, y+66);
line(x+39, y+7, x*2, y+67);
line(x+39, y+7, x*2, y+68);
line(x+39, y+7, x*2, y+69);
line(x+39, y+7, x*2, y+70);
// GREEN
setcolor(GREEN);
line(x+39, y+8, x*2, y+71);
line(x+39, y+8, x*2, y+72);
line(x+39, y+8, x*2, y+73);
line(x+39, y+8, x*2, y+74);
line(x+39, y+8, x*2, y+75);
line(x+39, y+8, x*2, y+76);
line(x+39, y+8, x*2, y+77);
// BLUE
setcolor(BLUE);
line(x+40, y+9, x*2, y+78);
line(x+40, y+9, x*2, y+79);
line(x+40, y+9, x*2, y+80);
line(x+40, y+9, x*2, y+81);
line(x+40, y+9, x*2, y+82);
line(x+40, y+9, x*2, y+83);
line(x+40, y+9, x*2, y+84);
// CYAN
setcolor(CYAN);
line(x+40, y+10, x*2, y+85);
line(x+40, y+10, x*2, y+86);
line(x+40, y+10, x*2, y+87);
line(x+40, y+10, x*2, y+88);
line(x+40, y+10, x*2, y+89);
line(x+40, y+10, x*2, y+90);
line(x+40, y+10, x*2, y+91);
// MAGENTA
setcolor(MAGENTA);
line(x+41, y+11, x*2, y+92);
line(x+41, y+11, x*2, y+93);
line(x+41, y+11, x*2, y+94);
line(x+41, y+11, x*2, y+95);
line(x+41, y+11, x*2, y+96);
line(x+41, y+11, x*2, y+97);
line(x+41, y+11, x*2, y+98);
getch();
closegraph();
}

No comments:
Post a Comment