20 de fevereiro de 2009

Projeto I

Tentativa de Estrela! xD

//Se ajudar em algo já ta bom!

#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{

int x,y;

int gdriver = DETECT, gmode, errorcode;
initgraph(&gdriver, &gmode, "");
errorcode = graphresult();

if (errorcode != grOk)
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}

cleardevice();

x=getmaxx()/2-50;
y=getmaxy()/2-50;

//CENTRO*********************************
setfillstyle(SOLID_FILL, WHITE);
setcolor(WHITE);
line(x, y,x+80, y);
line(x, y, x-30, y+80);
line(x+80, y, x+110, y+80);
line(x+110, y+80, x+40, y+110);
line(x+40, y+110, x-30, y+80);
floodfill(x+1,y+1,WHITE);
//*********************************************

//PONTA DE CIMA***********************
line(x, y, x+40, y-110);
line(x+40, y-110, x+80, y);
floodfill(x+1,y-1,WHITE);
//********************************************

//PONTA DIREITA***********************
line(x+80, y, x+190, y);
line(x+190, y, x+110, y+80);
floodfill(x+80+1,y+1,WHITE);
//********************************************

//PONTA ESQUERDA**********************
line(x, y, x-110, y);
line(x-110, y, x-30, y+80);
floodfill(x-1,y+1,WHITE);
//**********************************************

//PONTA DIREITA DE BAIXO**************
line(x+110, y+80, x+150, y+190);
line(x+150, y+190, x+40, y+110);
floodfill(x+110,y+90+1,WHITE);
//**********************************************

//PONTA ESQUERDA DE BAIXO*************
line(x-30, y+80, x-80, y+190);
line(x-80, y+190, x+40, y+110);
floodfill(x-30+1,y+80+1,WHITE);
//*************************************************

getch();
closegraph();
return 0;

}

2 comentários:

Anônimo disse...

Sertinha a estrela.

AAA disse...

nem tanto! ^^